You need to check if your are an op on the channel by either:
on @*:JOIN:
or
on :JOIN: { if ( $me isop $chan ) {