It's a single-script-only function, so on the script that does all of the work, just put it in there. It'll only be active for that script, and if he bails on it, it'll finish what it was doing anyway.
As for the javascript approach, making it work in all browsers isn't that hard, so long as you generalize. Like using
document.forms[0].submitButton.disabled = true;
# instead of
document.formName.submitButton.disabled = true;
Plus, you should have a good idea of what browsers you'll actually need to support, considering your limited user base for this page. But there's always the possibility of javascript being turned off in the browser, so it's a toss up.
Now knowing what you're doing in this script, I have to ask what kind of database it is. If it's MySQL, shame on you :p
If it's Oracle, Postgres or the like, then maybe the bulk of your database work could be put into a stored procedure. Then it would just be a matter of passing the variables to the procedure and being done with it. So instead of php having to wait for it to finish, you just call the proc. Just an idea...