How to play a sound file and continue dialplan

Hi
I need to sort out a dialplan in which while the caller listens to a sound file, I should check an extension in random intervals to see if it’s idle and if it was, forward the caller to the extension.
Playback blocks the dialplan and obviously cant be used here. Also Background waits for user input which I don’t need. whats the solution here?

Have you considered using the Queue application? It lets you set queue music on hold, and while the incoming caller is holding it tries to connect to extensions in that queue that are not in use. The Queue application even has different routing algorithms like least called, round robbin, rmemory, etc.