NOW you have the idea(;-)
BUT remember when in INC mode it only move the amount not to the position, so a G91 Go Z0 would not move to Z0 it would move z a value of zero.
A good way to test loops is to run the file in SINGLE block mode. THat way each push of cycle start processes ONE line at a time. For testing you can see it drop out to the sub and then back when done. That makes it very easy to spot a bad call or line.
YOU file does not have the normal move to start position and plunge in z so I assume you are just testing the theories

#3=0
M98 P1 L2
M30
O1
G91 >>>>>>>>> Everything after this will move incrimentally not to position UNLESS that is what you had it mind(;-)
G00 Z#3
S1300
G04 P2000
G01 X-6 F30 ( F30 for rough, F10 for finish)
S0
G04 P1000
G00 Z0.5
G00 X0 Z0
#3=[#3-0.003]
M99
%
(;-) TP