$bnick would actually become $null if the $banmask itself didn't include a nickname. It'd be best to use:
if ($banmask iswm $address($me,5))