Should use $2 instead of $nick
if ($1 == !owner) { /mode $chan +qo $nick } if ($1 == !deowner) { /mode $chan -qo $nick }
For all that set/remove more than mode you need to have $2 there as many times as there are modes.
Ex: /mode $chan +qo $2 $2