errm why add rediculous amounts of code, one you could use the server commands and two that code is way to excessive.
this would be better:
alias opon {
.set %op on
}
alias opoff {
.unset %op
}
on *:JOIN:#:{ if (%op == on) {
.mode # +o $nick
}
}
Simple usually = better oh and does not involve stupid %var changes.