There is not a way to do that BUT you can get really close. The capture code will be just a Squeek before the actual pause process starts.
You have to modify the Pause button to allow CB code. It depends on where you want to store the variables Xpos Ypos. This example stores the Xpos and Ypos tand Zpos to #vars 1000 and 1001and 1002. And the current line number to #var 1003
SetVar(1000,GetDro(0))
SetVar(1001,GetDro(1))
SetVar(1002,GetDro(2))
SetVar(1003,GetDro(16))
DoButton(1)
While Ismoving()
Wend
Code"G91"
Code" G0 Z.250"
Code"G90"
Code" G0 X#1000 Y#1001 Z#1002"
Code" SetDro(16,GetVar(1003))
Hope that helps, (;-) TP