I think there might be a better ways then looking at the number of files in a directory....
can you trigger an external switch with your machine?
You can also use Flash with Zinc to access full functioning VB!
If you want to look at the amount of files in a directory use:
'Get File count
GetFileCount = objFSO.GetFolder(folderpath).Files.Count
You could also look at the file name and have set functions per file name as well.
Here is some quick code to do what you want I think

...at least its a good starting point to get what you want perhaps.
I have not tested it on a machine... and barely debugged it

I'm thinking your machine is staring from the bottom left corner and working to the right 8 steps.....then when reaching 8 steps... up 1 row.... and back over to step 1 then over 8 steps etc...
1. Copy past the code below in to a text File.
2. Rename the text File to "Macropump.m1s"
3. Drop "Macropump.m1s" in to your profile Example "C:\Mach3\macros\Mach3Mill"
4. Add a button to toggle LED2000 on/off to activate the script
You can also add DRO2000 to see how may files are in there.
'Ignore If loading a file
ProgLoading = IsLoading()
'***Make a Button to turn on/OFF LED2000 (This could be your run button)***
'Ignore If loading a file and if LED2000 is off
If(ProgLoading = 0 And GetUserLEd(2000)=1) Then
'***Create file system object***
'File Sytem Object
Dim objFSO As Object
'Set VB System object
Set objFSO = CreateObject("Scripting.FileSystemObject")
'Folder path
folderpath= "C:\automation"
'Check to see if the folder is there
If objFSO.FolderExists(folderpath) Then
'Get File count
GetFileCount = objFSO.GetFolder(folderpath).Files.Count
'No files
If GetFileCount = 0 Then
'***Set Default Values***
'Clear interLock
Call SetUserDRO(2000,"0")
Print "File Count Zero"
'Send Machine to Zero's !!! You might want to set a LED before doing this and send the axis to zero :)
'Code("G1 X0 Y0")
'***File Number return larger then 0 see how many***
Else
'If new file added Store in a DRO InterLock
If Not GetOEMDRO(2000) = StoredFileCount Then
Print("Stored Value " & GetOEMDRO(2000))
'Store new value
StoredFileCount = GetFileCount
'Store interLock User DRO 2000
SetOEMDRO(2000,StoredFileCount)
'***Depending on File count will depend will trigger one of the Case statments***
'***Check Row Count***
Select Case GetFileCount
Case 8
'Move Y up + 9mm
MoveY = getoemdro(801) + 9
'Move Y
Code ("G1 Y" & MoveY)
'Move X
Code ("G1 X0")
Print "Row "& GetFileCount
Case 16
'Move Y up + 9mm
MoveY = GetOemDRO800 + 9
'Move Y
Code ("G1 Y" & MoveY)
'Move X
Code ("G1 X0")
Print "Row "& GetFileCount
Case 24
'Move Y up + 9mm
MoveY = GetOemDRO800 + 9
'Move Y
Code ("G1 Y" & MoveY)
'Move X
Code ("G1 X0")
Print "Row "& GetFileCount
Case 32
'Move Y up + 9mm
MoveY = GetOemDRO800 + 9
'Move Y
Code ("G1 Y" & MoveY)
'Move X
Code ("G1 X0")
Print "Row "& GetFileCount
Case 40
'Move Y up + 9mm
MoveY = GetOemDRO800 + 9
'Move Y
Code ("G1 Y" & MoveY)
'Move X
Code ("G1 X0")
Print "Row "& GetFileCount
Case 48
'Move Y up + 9mm
MoveY = GetOemDRO800 + 9
'Move Y
Code ("G1 Y" & MoveY)
'Move X
Code ("G1 X0")
Print "Row "& GetFileCount
Case 56
'Move Y up + 9mm
MoveY = GetOemDRO800 + 9
'Move Y
Code ("G1 Y" & MoveY)
'Move X
Code ("G1 X0")
Print "Row "& GetFileCount
Case 64
'Move Y up + 9mm
MoveY = GetOemDRO800 + 9
'Move Y
Code ("G1 Y" & MoveY)
'Move X
Code ("G1 X0")
Print "Row "& GetFileCount
Case 72
'Move Y up + 9mm
MoveY = GetOemDRO800 + 9
'Move Y
Code ("G1 Y" & MoveY)
'Move X
Code ("G1 X0")
Print "Row "& GetFileCount
Case 80
'Move Y up + 9mm
MoveY = GetOemDRO800 + 9
'Move Y
Code ("G1 Y" & MoveY)
'Move X
Code ("G1 X0")
Print "Row "& GetFileCount
Case 88
'Move Y up + 9mm
MoveY = GetOemDRO800 + 9
'Move Y
Code ("G1 Y" & MoveY)
'Move X
Code ("G1 X0")
Print "Row "& GetFileCount
Case 96
'Move Y up + 9mm
MoveY = GetOemDRO800 + 9
'Move Y
Code ("G1 Y" & MoveY)
'Move X
Code ("G1 X0")
Print "Row "& GetFileCount
'End Case Statment
Case Else
End Select
'END If new file added Store in a DRO InterLock
End If
'END No files
End If
Else
'No folder exist
MsgBox "Bad File Path"
'END Folder exists
End If
'END Ignore If loading a file
End If
'Clean up
Set objFSO = Nothing