You need to compile all your ON INPUT events into one routine, instead of having multiple ON INPUT events.

mIRC has the ability to trigger a given event in every script file you have loaded, thus it can do exactally what you're describing.