You could be running into blocking that stalls your script. But it could also be that some table is big and takes a long time to process.
On my web site, you find beta_lockinfo which is a free stored procedures, which will reveal both blocking and what statement the process is currently running.