Apparently you can use the function Utilities.sleep() like this:
function onSubmit() {
// we've been called, remove trigger, set timeout, re-enable, and then run function
destroySubmitHandler();
Utilities.sleep(5 * 1000)
createSubmitHandler();
myFunction()
}