sorry, I've missed the -c part

Althought i'm not sure if this works,even if it does for those 10 secs mIRC will do a great number of itterations, and that's the reason for this "crash" (which may be just a huge slowdown)
why don't you use a timer to do that?
use %!window-close to reevaluate the variable, I've got something like this and it works fine