alias goodwords return $regex($1,$+(/,$replace(%goodwords,$chr(32),,$chr(44),|),/Si))
alias badwords return $regex($1,$+(/,$replace(%badwords,$chr(32),,$chr(44),|),/Si))
if $goodwords($1-) { ... } --> will trigger if one of the good words is in $1-
if !$badwords($1-) { ... } --> will trigger if none of the bad words are in $1-
I must say, that I think a hash table and $hfind will be more appropriate for this kind of thing. Why? The regex will get slower when your %goodwords and %badwords start getting big, and in a hash table, you can add many more items than you can in a variable.
Greets