Using isin here is wrong, if i have the variable like this :
%var #channel,#channel1...
if $chan is for exemple #chann, it will match whereas it should not, $istock would be the right way, but here, the best way would be :
on *:text:*nigger*:$(%swearkick):msg $nick NO Racism. | kick $chan $nick NO Racism
And your first example isn't more stable, the two code are doing exactly the same thing.It's just that in that case, you can avoid one line.
For the OP, you could check if the user have the +e mode before banning, and you might want to remove his protection, but he could then put it again...
Also, why do you use two different on text for the same match, just use /ban -ku in one event.