The other one I use sometimes, but is also not the most convenient, is the ProgressBar (when the Cancel button is allowed upon creation) and its ProgressBar.OnCancel Event , which is a tool that already exist in the Inventor API. There is an 'API Sample', but that sample is not include showing the cancel button, or handling the OnCancel event.
Years ago, although I had used it for some situations on occasion, I was skeptical about using it for situations where I may need to escape an endless loop type scenario, because I did not understand that much about 'threads / multi-thread processing' (and am still not an 'expert' in that area'), and I know that the ProgressBar was part of Inventor, and that Inventor may be frozen up at the time. But later, I heard from a couple people including @JelteDeJong(in his Blog post) that, when set-up properly, it actually works on a different thread than the loop is running on, so it was a viable candidate for that type of use. So, I often find myself incorporating that into my code solutions where a code could take a long time to run. I do generally try to avoid using Do...Loop, While...End While, and similar types loops, when possible, but have found a few places where they seem to be the better option, and in those cases, I may incorporate this also.
It is somewhat advanced though, because it does involve multi-sectional code layout, and the creation and use of EventHandler(s) to monitor some of Inventor's Events (not the iLogic Event Triggers), which most beginners do not understand much about yet, so maybe not a one size fits all type 'workaround'.
A had also heard about multiple similar ideas to the text file thing, where you would have a line of code within your loop that checks for something outside of Inventor's scope, but did not like the idea, due to most of my stuff being used by several other folks sometimes, and not having any control over things like that on other peoples computers.
All these types of ideas all seem to come down to the same basics though...having the forethought to either avoid creating a loop that may end up being endless in the first place, or having the forethought to include something special like one of these ideas within the loop as you create it.
Wesley Crihfield
(Not an Autodesk Employee)