I suspect you need an index on one of the tables to improve the query performance.
You really need to work out which queries within the set of queries is taking a long time to execute. You could do this by adding PRINT statements after each query reporting the time it took. Just add this around each statement:
DECLARE @DateTime as datetime -- At the top of the script
SET @DateTime =getdate()
--SQL Statement here...
PRINT CONCAT('Update 1 took ',DATEDIFF(ss,@DateTime ,getdate()),' seconds')
SET @DateTime =getdate() -- reset date to now
Another option would be to log the query times to a table.
Once you've fond the offending queries it should be easy to fix the problem.