Stop loop works.
The problem comes from the fact that your for loop will run every tick as you haven't filtered it otherwise. (reference: how events work
If what you're looking for is to make it run once, don't use stop loop, make your for loop a sub event of a start of layout event. It will only run once on start of the layout.