Why would you want to use the messenger API?
You can change virtually everything from inside the script...
Like Messenger.MyName changes your nickname, etc
(You can find all information in the
Scripting documentation)
If you really need to use the API, you can indeed make a dll in VB or an ActiveX and call it from the script
Edit: added link to scripting doc