Welcome to the forum
At a quick glance, the only obvious problem I can see is with the way you assign "onreadystatechange".
code:
request.onreadystatechange = processReadyStateChange();
There is a difference between "processReadyStateChange", which is a pointer to the function so it can be used for callbacks etc, and "processReadyStateChange
()" (note the parentheses) which actually calls the function and grabs whatever value it returns.
So simply change it to:
code:
request.onreadystatechange = processReadyStateChange;
and all should be well
Edit: additional note, updating every 5 seconds won't always work as the Messenger protocol has limits on how many times you can update your personal message/name. I think it is set at 6 times per minute, somebody correct me if I'm wrong