Eh... This is horrible! I made this example script on the spot, but I guess you get the idea of it...
on *:INPUT:#: { if ($regex($1,/(:?[+|-])(:?(\\w+))/S)) { if ($regml(2) isincs $remove($chanmodes,$chr(44))) { mode # $regml(1) $+ $v1 $2- } } }