G-code loop

I am using Arduino Mega2560 & Ramps 1.4.PC user.Sent my code with Repetier.

Since I can control my MPCNC with Repetier, I started to write my own G-code. In the code, I tired to loop the code. I have tried M41, M98,99 and While loop. They don’t work… Is there bug in my code? Is there a way to loop G code? or Repetier and Marlin do not support it.

There is my code. Feel free to comment.

------------------M41(not sure how to apply, require using SD card??)------------------------------
G01 X10.0000 F500.000
G01 Y10.0000 F500.000
G01 X0.0000 F500.000
G01 Y0.0000 F500.000
M41

---------------While--------------------------------------------------------
#100 = 1
WHILE [#100 LE 5] DO1 ;(loop 5 times)

G01 X10.0000 F500.000
G01 Y10.0000 F500.000
G01 X0.0000 F500.000
G01 Y0.0000 F500.000

#100 = #100 + 1 ;(Increase #100 by 1 each iteration of the loop)
END1

--------------M98 & M99-----------------------------------------------------
M98 P2 L10 (call sub 10 times)

G01 X10.0000 F500.000
G01 Y10.0000 F500.000
G01 X0.0000 F500.000
G01 Y0.0000 F500.000

M99

Not in Marlin that I know of, I believe you have to have Mach3 for something like that.

Thank you for answering. Then, I will do it in the simple way-C&P.