Unfortunately, there is no other way to repair a corrupted account. Also, due to the complex things that you need to do (give administrator privileges to a user, show hidden files, create new user account and so on) there is no way to use a script for this job. The only way to do this is by following the method that you describe.