Yes Phil.
I use the AppleScript Handler to automate different chats.
In this forum and AppleScript mailing list, I have created a post with no response at the moment.
I have deployed the script and it works with a bug (I think) that I have reported to Apple.
And yes, .applescript format.
In my opinion, there´s lack of info with AppleScript handler for Messages.app.
Yes, to my surprise, Messages is compiling and executing its own AppleScripts.
My user was actually trying to implement a screen sharing session using the auto accept script, but as I discovered after a bit of digging, that was only ever available in iChat: