From a programming standpoint, it would have to be something like:

1- Use /afk to indicate that you're away.
2- You are automatically shuffled back in the queue whenever someone with your role is "behind you"

In other words, you'll percolate backwards in the queue, until you're at the very back.

...which is equivalent to you just having dropped out of the PF, and then re-queue'ing when you get back. So why bother doing any fancy coding?