It's really hard to tell what acutally is going on as the posted script fragments don't make sense. If there's a code segemnt to update a trime display like @TIME, then there needs to be an OnTime event defined and the DoEvents section is necessary to trigger the timer event.

However, then the other code sections need to reworked, too. If it is just a linear script with an incrementing counter then the DoEvents section is not necessary.

But without the exact details of what the script is supposed to do and the complete code, it's hard to tell.
_________________________
There are two types of vessels, submarines and targets.