Ansible plays are hashes, they are a collection of attributes.
Tasks are an ordered list.
Thus including “vars_prompt” ahead or behind “tasks” makes no difference.
vars_prompt happens before the current play runs, every time.
You can solve this problem by stopping the current play, starting a new one with a vars_prompt in it, and then continuing, since a playbook can contain multiple plays in a single file.
Seems you are asking a bit of a different question…
I don’t particularly like this suggested approach because it conflates two very different concepts - prompting with setting variables, in one line that is hard to read. Also, ansible only accepts one value for each argument, so specifying prompt twice is weird, and specifying the name of the variable in the prompt string is very un-ansible-like as well.
Two, it sounds like what you really would want is a new action plugin called “prompt”, which I would be open to, which would look a lot like the source to pause.py