There's nothing wrong, the $hfind value is $null
Edit : it might be because you've specified a badword that don't exists just check the value, here the else part :
else {
tokenize 32 $2-
var %a = $0
while %a {
if ($hfind(Badwords,$($+($,%a),2),1).data) .hdel Badwords $v1
;else var %er = %er $v1
dec %a
}
}
I've put an else in case you want to retrieved the words that aren't deleted