[Copied Paul's question from another thread to try and keep discussion contained.]
Just to make sure we're all on the same page, here's how I use the various terms:
Entry Action - Executes one time every time the state is entered, regardless of the previous state.
Execution* Action - Executes continuously until the state decides it's done.
Exit Action - Executes one time every time the state is exited, regardless of the next state.
Transition Action - Executes after exiting one state but before entering the next state. Each transition action is associated with one arrow on the state diagram.
(*Also known as "Do Actions" or "Input Actions," depending on the literature.)
You're thinking in QSM terms where each case is a state. That's a flawed approach. It requires you to repeatedly exit and re-enter the state so you can monitor the queue for new messages. As you said, you have to somehow keep track of whether we're re-entering this state or entering it from another state to be able to handle entry actions.
I skip all that confusion and use separate vis for EntryActions, ExecutionActions, ExitActions, and StateTransition methods. The action sequencing is done by the StateMachine:Execute method, as shown below. The outer loop executes only one time for each state. The inner loop continues executing the state's ExecutionActions method until the state receives a combination of input signals the state understands as a trigger to transition to a new state.