I appreciate the added note. I had not heard anything about the ProgressBar running on another thread, but like you, I am not 100% sure if it might be true because I do not recall ever personally testing that specific functionality of it being able to stop a process in Inventor that was causing it to freeze up. If that is true, it would certainly be nice. I still would not be able to use a ProgressBar to stop just one of multiple event handlers that are running in the background through, because they do not really make 'progress' or use a loop, they just react to a specific event when it happens. I have seen an example or two of laying out different code routines in a way that would cause Inventor to do two (or more) things at the same time on different threads, to help improve performance, but I have not delved that deep into it myself before. In the past, I had heard that Inventor was not that good at utilizing multi-threading functionality, but in more recent years I have heard that it is getting better. I just generally do not use iLogic for tasks that are going to take a super long time to process while I am still present at my computer.
As for how to create and use custom event handlers...although we can create and use these from iLogic rules, they are generally best suited for Inventor add-ins. A couple years ago I had an knowledge base article published on the knowledge.autodesk.com/community/ domain about that topic, but they took all user submitted articles down about a year ago. I have attached a PDF of what remains of that article. Within that article you will find the two main ways to deal with them, a bunch of links to some of Inventor's events that you can listen for, and a brief example iLogic rule which uses a couple of them. That example is not a really good one, and there are a several more events available now than there were then, but its at least a starting point. Each event has its own 'handler' Sub routine definition line that was designed by the folks at Autodesk, which we utilize as needed. Then we can put our own custom code within the routine, for how to react to the event. There are a few main precautions about creating event handlers with iLogic rules to keep in mind. Once you start one, depending on its scope, it will most likely keep running in the background until you close Inventor, unless you incorporate something into the rule that creates it, to remove it at some point. You can not simply change the code within the rule that launched it after it has been launched to change its functionality, because that original code is then being held in Inventor's session memory while it is running. So, in some early event handler testing, you may have to close Inventor to get rid of the one that is already running, unless you make them a 'one shot' routine. In a one shot routine, you just remove the handler at the end of the Sub routine that reacts to the event the first time.
Wesley Crihfield

(Not an Autodesk Employee)