Added a few necessary spaces to code and fixed the SendChatMessage if statement to now correctly send a chat message as long as the XPS_CHAN global is not "off" - previously would not ever send a chat message (embarrassingly).
Now should be working "as intended" (touch wood).