This is all you need for mode change instead of doing all the if and elseif statements:
on @*:INPUT:#: { if ($regex($1,/^((?:\+)|(?:\-))([a-zA-Z]+)$)) { mode # $+($regml(1),$regml(2)) } }
Note: I didn't include the chanop and ban but they can be added this way.