if ($nick isop $chan) || ($nick ishop $chan) { can be combined into:
if ($nick($chan,$nick,oh)) {
And yes, instead of banning $2, you should consider using $address($2,2) By banning nicks, people can change them and bypass the ban instantly.