One thing I would do is that, when we enter this function, if $('#keystone_delay_auth_decision') is not disabled, then we save this value so that when we disable it, and then re-enable it, we can set it back to this old value. There is some code similar to this in barclamp-neutron.