_IELoadWaitTimeout will change the length of the timeout. The default is 5 minutes - set it lower. Look at the @error values for _IELoadWait to find the value returned after a timeout and test for it.
Regarding PsaltyDS's comment... yes, I would rather you spend 30-40 minutes figuring this out on your own. Please remember that this is a very busy forum and anything that gets posted may be read by hundreds of people... do the math. And it may have taken me 3 minutes to write this reply, but who is to say that my 3 minutes isn't more valuable than your 30-40 (actually, I already know that it is - to me. I only spend my time here replying in hopes that you will learn from it and ask better questions in the future... if not, I'll keep my 3 minutes next time).
Dale