>I know there are other solutions to this problem, but there have been so many times when I want to have better control over event processing, so my question is how can I programmatically trigger an event to be processed in the event loop instead of immediately?
Among simple tricks is to have an inactive timer which you will activate, have it do what you want after some milliseconds and deactivate again.