js code:
if(Enabled == 1) { Enabled = 0; }
if(Enabled == 0) { Enabled = 1; }
Could just be:
js code:
Enabled = !Enabled;
Also, the ChatWndSendMessage event appears to be in an if statement... No experience with this (I'm guessing though it's not right), but I would say that's why it only works properly in one condition.