If it was something that mIRC was adding, I would expect it to happen all of the time, but it doesn't.
As to another script interfering, I've already eliminated that by testing the code with no other scripts loaded, and all variables being unset using /unsetall

The only way that I've been able to guarantee the problem showing, is by making a channel that has no topic active, then going to one that has a topic.