I tested your script several times and it ran without any issues. I also tried changing the /timer to a millisecond timer using:

Code:
.timer -m 10 %t query %b

to repeat and speed up the process and it still ran correctly. Tested under Windows XP, 7, 8.1, and Wine.

Do you have any anti-virus/security software installed? If you disable/unload it completely and test again, do you still see this issue?

If you install a clean copy of mIRC, using the portable option in the installer, to a new, empty folder in your documents folder, and run this script in that copy of mIRC, do you still see this issue?