If it was me I would just work it from ON INPUT:?: though I am unsure of how to get mIRC to cancel the variable I would set to block more than one CTCP once the return key is pressed. I haven't done much mIRC scripting (aside from making a small bot to hammer the Fizzer virus with) in the last year or so, so I reckon I have forgotten a few things.
Only thing is, I think ON INPUT:?: would only work with a message window open, but not with just typing /msg name blah on a channel or status window.