First time through, this.script.src.readyState is false (script still loading) and a handler is created for the onLoad event. When onLoad is triggered, the anonymous onLoad function is called - which appears to be very similar to the onReadyStateChange handler. However, onLoad is triggered only once, so your function is called only once.
The sleep slows execution enuf so your this.script.src.readyState is true when you execute the if statement.
What do you think?
Upper Stage
2010-02-12 17:12:32