the \"#CHANNEL\" inside the event can just be \"$chan\" so whoever will be using the code will only change #CHANNEL once.
$bnick will only return a value of the nick was included in the ban mask. Just FYI.
Also put a check if the user of the code is an OP.