Not sure how hard this would be to implement but an awsome addition to the scripting language would be /when for example.
on *:connect:when ($me ison #test) msg chanop op #test $me
or a better way would be to use it as an event hander
when:$me ison #test:msg chanop op #test $me
Imagine the possibilities.