setTimeout with a small delay will allow your control flow to proceed while scheduling another function to execute later. This is especially useful to prevent the UI from blocking or being inadvertently dependent on the successful execution of the other function.
I find it very useful to prevent javascript errors from interfering with bound events. For example, to install a submit handler on a form:
$('#form').submit(function() {
setTimeout(function() {
// Submit handler function, i.e. do an ajax submission of the form
$.ajax(...etc...);
}, 1);
// Return false before the handler executes, ensuring the form won't manually submit
// in the event of a js error in the handler
return false;
});
<script>tags or execution of javascript functions?