Kick/ban scripts have been done a lot. Please use the Search feature.

Also note that there is, realistically, no way for a script to tell if a nick is proper or nonsense (or at least not without a lot of extra coding)