There really isn't much reason to use a hash table. You already know who is on the channel. Just ban them that way. You can loop through the nick list using $nick($chan,N) where N is the number of the nick. You can also use that to only ban regular users or regular and voiced users or whatever so you're not banning the ops. The only thing to keep in mind is that you need to check that $address() exists for each person because anyone in the channel when you join who doesn't type or do anything won't have an updated address. For anyone without the address, you'll need to check /userhost or /who or /whois to obtain the address of that nick before you can ban them. Of course, your script doesn't handle anyone who is already in the channel when you join anyhow. So if you want it to just work like yours, then skip anyone without an $address().
Notes on yours...
* Two many }'s on the on JOIN event.
* You are adding the ITEM $address to the table without and DATA and then you're banning using DATA. That won't work.
* Banning each person separately is a huge flood. You should check what the server allows for multiple bans and ban them in groups (e.g. +bbbb address1 address2 address3 address4).
* Use @ on your event to check if you are an op instead of using an IF ($me isop $chan) line.
* For while loops and anything else that is only used within the script and not needed once the script finishes, it's usually best to use local variables instead of global variables (/var instead of /set).
* You are missing a } in your on TEXT event.
* You aren't removing anyone who QUITS.