080118-0825 EST USA
#101 does not appear to be a counter by my normal definition, but rather the cummulative depth as you progress. Defining it as a counter really had me confused as to what you were doing.
When you do #101 = 0 you are initiallizing Z to 0 relative to whatever G5x is active.
#100 is your final depth, it has to be negative, and is based on G5x Z0. You assume no material above Z0.
IF[#101 LT #100] THEN [#101=#100] this is OK now that I understand #101 is not what I expected for a counter. In a broad sense you can call this a counter but it is not what one initially would visualize as a counter.
IF[#101 EQ #100] GOTO200
I might change this to
IF[#101 GT #100] GOTO 100
Why was I confused? When I look at code it is usually a whole mess of useless stuff cluttered around the basic logic. Thus, based on bits of information I jump into to it to see what the basic logic is. Here I started looking at #101 because it was defined as a counter. Then why would I want to set #101 to the value of #100 inside of the loop?
G01 Z#101 F15.
G90 G41 G01 X2.375 Y4. D21
G03 X2.7606 Y2.174 R1.25
G02 X2. Y0.2794 R1.1
G02 X1.2394 Y2.174 R1.1
G03 X1.625 Y3.077 R1.25
G40 X3.25 Y5. F25.
Had been written as
G01 Z#101 F15.
(do cutting work)
#101=0 (ENSURE COUNTER IS CLEAR)
#101=0 (cummulative depth from G5x Z0, initialize to start at Z0)
#100=#1(final depth relative to G5x Z0)
I would have converged on your logic sooner.