The easiest way is o look at the file remote.tcl it has simple code to do simple tasks.. here's the code that should do what you need, it's from the 'proc msg' function, so take a look there :
set input [text ${win_name}.tmp]
$input insert end "${message}"
::amsn::MessageSend $win_name $input
destroy $input
This should send the message (it makes amsn think that you typed the text in the input window, faking the input window.. I'm sure there's an easier/cleaner way, but sorry, I don't have time to look at the code right now to find the appropriate function.
good luck