It would be useful to implement interrupts. Instead of triggering events on step entry/exit/timer or a button that requires you to push it, use something like a virtual machine or device you can configure.
An example might be if a table record is updated, a variable set, etc. This would immediately run the associated interrupt trigger. You’d have to set the virtual device to watch that input (or series of inputs), etc.