Because I am an utter spaz who can't wait the 1 - 2 days it'll take to get some documentation on the chat object, here's how it works:
f will be the Turbine.Chat.Received function, and args will have the fields "Sender", "ChatType", and "Message". Looks like it'll need a handler manager so scripts aren't stomping on each other's chat handlers.
function Turbine.Chat.Received(f, args)
for k, v in pairs(args) do
Turbine.Shell.WriteLine(k .. ": " .. tostring(v));
Edit: Oh, and it looks like Turbine.Shell.WriteLines don't trigger the chat received event, so you can't send yourself into an infinite loop that way.