^You need to store your own bans someway (variable, ini, hash) and then compare the unban to the stored. Search the snippets and forum for such a script or searcA h the forums... If not found, ask.
About the snippet, its a bit to simple, and needs a flood protection so that you dont flood of the server. You should also allow it to be turned on and off ..