Well, that's what $hfind() with W does. Read the link I pasted in my first post carefully, there's no way I could explain it better than Pasmal in that article. In short, your code should be modified like this:
Code:
on @*:JOIN:#: {
  if ( [color:red]$hfind(blacklist,$fulladdress,1,W)[/color] ) {
    mode $chan +b $mask($fulladdress,3)
    kick $chan $nick $hget(blacklist,[color:red]$ifmatch[/color])
  }
}