Code:
on @*:join:#:{
  if (%door == off) || (!%door) || ($isexempt($nick)) { return }
  if (% [ $+ [ $wildsite ] $+ ] .rd == $null) { set -u30 % [ $+ [ $wildsite ] $+ ] .rd on }
}
on @*:PART:#:{
  if (%door == off) || (!%door) { return }
  if (% [ $+ [ $wildsite ] $+ ] .rd != $null) { ban -u600 # $mask($fulladdress,2) }
}


Use my $isexempt alias to check if they're in the list or not.

I didn't add it for the On Part event because if the var isnt set for them when they join it's not going to be there if/when they part.