Ah, I see what you mean now. My guess is this is because Windows treats the application as "not responding" after 5 seconds. When it enters the "not responding" state, Windows is probably no longer indicating to mIRC that the program is active, thus the color change. Loops shorter than 5 seconds don't cause this to happen.