It might work, but I'm afraid that we have some users where their UPN is different from SAMAccountName and they are already registered in moodle, wouldn't this criple their ability to logon?
Now I understood your problem. If user is already registered, after he log into system after changing configuration, he must be registered the second time. I don't think that the problem can be solved in Moodle. Sorry, but I don't know any method.
May be you can solve the problem externally?