I don't have much time to debug it, but here are a few things which I can say about good practice:
1) Your status doesn't have anything to do with it.
2) Don't use the OnEvent_Initialize() function to read in the XML. As you can read in the
scripting documentation, the OnEvent_Initialize() function should return as quickly as possible and is not a good place to do process intensive tasks.
Instead use the OnEvent_SigninReady() function to do that. It also makes more sense because if you are never going to sign in, it is useless to read in the XML and set things up.
3) Before using ChatWnd.SendMessage you should always check if you can actually send a message by using ChatWnd::EditChangeAllowed. Again, see official scripting documentation.
Now, the above pointers don't realy fix anything. But they will prevent possible problems in the long run.
4) There is probably something wrong with the ActiveX object you use. Try to get some documentation about it and study it carefully.