for your first question, you should use the function OnEvent_ChatWnd
ReceivedMessage(ChatWnd,Origin,Msg,Kind){
as for the second question, Messenger.MyContacts isn't a string so it doesn't work like that. You need to do
code:
Messenger.MyContacts.GetContact("put their email here").Name
to return their display name (which i think is what you want).