Here’s my guess as to why your proposal doesn’t work.
Let’s assume your pattern has 3 positions with the values 12, 0, 5, and that the playhead is at position 1 (which has value 0).
Now we trigger your script
IF EZ P.HERE : CV 1 VV P.PREV
ELSE : TR.PULSE 1
The value at P.HERE is 0, which is equal zero, so the IF command gets executed, which means that P.PREV decrements the index to 0 and then reads the value 12 at the new position. If you now advance the index to get to the next step (with e.g. P.NEXT, which is not shown in your script snippet, but I assume you do it somewhere), the index is moved to 1 again, which of course still has the value 0.
This means you are trapped in a loop, as you can’t advance past the first index that has the value 0: you can’t move to the next step, as reading the value of the previous index sets you back one step, so moving one step forward will make you read the value 0 again (and so on and so forth).
As far as I understand it, there is no need to recall the previous CV value, as it is held anyway until it is changed.