Make a password security check for the register form
It seems like you might want to look into the Password Policy module which probably has a lot of the features you are trying to rebuild.

I also wonder whether it makes sense to build your own user inscription form instead of altering the existing core registration form. Altering forms tends to result in easier integrations with existing modules.