I ran into a similar problem downloading a large SF report and looping through each line. You need to add an IF statement at the top of your loop to check the count of the index you are looping through and pause for .5 seconds every 4000-5000 rows. ...