The code itself is working for me... Do you get any error message? Can you confirm the code is executing at all, that is: does mIRC print all the commands if you replace the "window -g0"-line with
Code:
echo -s window -g0 $qt($window(*,%i))
?