Got the day off work today, so I've been able to spend the morning experimenting, and after a few hours I finally got somewhere...
I've tried a few different ways to make a loop using callbacks: buttons, multisliders, even looked into a zero length model animation, but none of those worked for various reasons. Then I decided to take another look at the collision callback method. After some tinkering I realised why the callback wouldn't stick and had to be re-applied.
Assuming that the engine "thinks" at 60Hz or fps or whatever, it can't recognise that an entity has
stopped colliding until at least the next frame after it
started colliding. So when using Amn's method, the enity is already back at the first area before the engine notices that it is gone. Removing and re-adding the callback forces it to re-notice the collision. I tried using 3 and even 4 areas, cycling the entity between them, but it was always back at the first one before the engine had time to "think" and noticed that it was gone. (Which is also why it doesn't appear to move at all, visually.)
So then I tried using just one callback for a single area, detecting when the entity goes in and
out of it...... Bingo! This method works, loops as long as you need it to and only requires 1 permanent callback. It clocks almost exactly 60Hz (slightly faster, 60.011666...Hz after 10min) and
doesn't cause a crash on (un)loading.
Now, I'm not going to get too excited until I've implemented it in the mod and playtested it... but keep your fingers crossed...
It you want to verify it, the map is attached below but
SCREEN BURN WARNING don't try it with a visible entity and
don't uncomment line 43 so that each loop displays a message. I left it running like that for 10 min and it burned a flickering box and column of messages on my screen. Luckily 45 min of screen cleaner video faded it out.
Ps. Sorry for double posting - I'm aware that I do that a lot. I figured it's ok if there's something new to say. If it's not ok just let me know.