The post password script still running after Universal Password fails - Migration

Scenario to reveiw:

In migration situation there is a ‘Get User’ script will be running after Change Password in ‘Universal Password’ page.

1- User Clicking on the link in the ‘Reset Password’ Email —> Universal Password page opening up.
2- After password entries and clicking on the button —> for the emails / users that are not migrated the ‘Get User’ will be run.

Here is my question : if the ‘Get Script’ for any reason take longer than 10 millisecond obviously due to the action limitations the universal password change will show an error (fails); and it is look like the post-password-scripts is also run after that (even if the ‘Get User’ timed out.

The post-password-scripts in my scenario is sending confirmation of successful password change to user; so user end up receiving confirmation email while universal password change throw an error!

HOW CAN WE PREVENT RUNNING POST PASSWORD ACTION IF GET USER FAILS OR TIME OUT IN UNIVERSAL PASSWORD CHNAGE IN MIGRATION SITUATION?!

Anyone can help, I need an answer for this issue ?