go to original layout // this will go back to the locations layout or no?
No. It will go back to whatever layout you were on when the script fired off. You need to replace this with:
Go to Layout [ Locations ]
As an aside, you can make this a lot easier (avoid all the layout switching) by using a ListOf summary field to collect all the IDs into a variable and then looping over that. (You can also use one of a number of available Custom Functions to collect the IDs if you don't want to create a new field.)
Thanks for the prompt reply Mike, changing that has sorted it.
But just as a matter of interest when you say it will return to whatever layout when the script fired off my mistake is thinking that in this case the layout would be the locations one as I set it to go there before the loop? I thought when entering the loop i'm still on locations layout until I do the freeze window and switch to a different one?
Yep. Key phrase being, "until I switch to a different one." Go to Layout does exactly that.
The "original layout" is the layout on which the script starts, prior to any steps executing. It should be used carefully for that reason. If you can't predict what that layout will be (and you often can't), explicitly set the context.