For our PBX we want to extend the "wrapup" functionality for a queue as we want to implement the wrapup time as well for outgoing calls.
My idea about handling it, so the workflow for our macro:
1. When an agent hangs up (any kind of call)
2. The agent will be removed as dynamic member for the queue
3. A timer will run for x seconds
4. The agent will be added again as a dynamic agent for the queue