Okay, you should probably change that quite a lot, perhaps something like this:
on *:TEXT:!topic *:#:{ if ($nick isop $chan) { topic $chan $2- } else { msg # You do not have the required operator privileges. } }