Code:
on @:UNBAN:#channel: {
  if ($hmatch(banlist,$banmask,1)) { .ban $chan $banmask }
}


Note: this code is untested but you should get the idea.