and that seems to be further confirmed by running mIRC for a time with you script running and trying to chat normally. I never got a popup with mIRC just idling, but usually when i either switch to the mIRC window from another window or change the active channel.

Memory related issue perhaps? I use the legacy fixedsys font... hmm.