I like everything that you've done here except one thing: the first and second parts of this if statement should generate different errors.  Otherwise, it may confuse an admin adding users--they see that no user with that name exists in the facility, but still can't add.

The first if clause should give the error below; the second should say something else... like that username is not available.