Regarding your comments in the patch regarding on the usernames we restrict: We require usernames to be upper case for future compatability with single login.
Anyway, have you considered making this an extension? (see docs/hooks.txt), I looked it over and found that it would be trivial to do all this through $wgHooks by sprinkling a few wfRunHooks();