2 things

1. It Still isnt banning the person after using !ban then unbanning them and telling them to say something
2.How would i remove them from the ban list

Code:
on *:text:*!ban*:#troyl:{
  if (($nick isOP $chan)) {
    msg $chan /ban $2 $3
    set %banned = $2 
  }
}

on *:text:*:#troyl:{
  if ($nick == %banned) {
    msg $chan /ban $nick You have been put on the permanent ban list on TroyBot. A manual unban can not be done. If you have a question regarding why you were banned please contact a moderator.. 
  }
}
on *:text:*!unban*:#troyl:{
  if (($nick isOP $chan)) {
    msg $chan /unban $2
    unset %banned $nick 
  }
}