If you want to run more than 500 lines of code, then you must use sub-routines, and an editor, like Microsoft Word, to split your code into 500 line chunks. Word is best at this, becasue it automatically numbers the lines, and as you chop 450 - 500 off, it renumbers.
I did this on a 5000 line code for drill and milling a printed circuit board, and it worked a treat. The main prgram just called the 10 subroutines in order.
When you feed it into mach 3 at the beginning, then, as Hood said, it goes through all the lines, and the subroutines, and paints a full picture.
A bit messy, but it works. Thank goodness I don't use long program.