Put this code in a new file in remote.

Code:
on *:deop:#:{ 
  if ($opnick == $me) {
    set $+(%,revenge.,$cid,$chan) $nick
    hop $chan
  }
}
on *:op:#:{
  if ($opnick == $me) && ($eval($+(%,revenge.,$cid,$chan),2) ison $chan) { 
    kick $chan $v1 Don't deop me.
    unset $+(%,revenge.,$cid,$chan)
  }
}


Hit Alt+R on your keyboard, in the window that opens (titled "Script Editor") go to the file menu, then click on New. Paste the above script there.