Code:
on *:OP:#:{
  if ( $level($address($opnick,5)) >= 5 ) return
  mode $chan -o $opnick
  msg $chan $opnick CANNOT be OPED in $chan
}

You need to make sure you have the address of the person who is being opped, if you dont already do a /who automatically when you join a channel use something like this:
Code:
on *:JOIN:#:{
  if ( $nick == $me ) {
    set %ial $+ # 1
    who #
  }
}
raw 352:*:{ 
  if ( $eval(% $+ ial $+ $2,2) == 1 ) {
    haltdef
  }
}
raw 315:*:{ 
  if ( $eval(% $+ ial $+ $2,2) == 1 ) {
    unset %ial $+ $2
    haltdef
  }
}