If you're curious about how we did it, take a look at https://github.com/46Bit/irepl. Messages Beta for Mac still has AppleScript bindings from iChat. We're (ab)using them to pass the iMessages to Heist and then reply.
Would you happen to know if there is some technical or crypto reason for this?
I can't wait to see what other iMessage-based services pop up now that the AppleScript bindings are exposed.