Some starting points:
tell application "iTunes"
\tset this_name to the name of current track
\tset this_artist to the artist of current track
\tset this_album to the album of current track
I believe that you would want to use Mozilla for the next step, and do something like
tell application "Mozilla"
revisedMessage = currentMessage+asdf; document.REPLIER.message.value=revisedMessage;
You could also try the insertion point or selection commands, but I can't seem to get that to work.
Hopefully, this will give you some idea of what needs to be done. It looked to me that mozilla had the most robust AppleScript environment just from the Dictionary, but I don't know. Good luck, you lazy bastard