No offense to your coding, but that first ON TEXT script would be a lot easier to read using multiple lines.

For a hash table, you have to start with making the table, using /hmake

Then you need to add or load the information into the hash table.
To add it, you use /hadd
To load it (which I would recommend using your current badwords.txt file) you use /hload

There are a lot of other command and identifiers that are used with hash tables. I suggest you read the help file /help hash tables to get some understanding as to what commands and identifiers do what.