Programmatically selecting every nth edge loop in a mesh?
By assuming your grid will be parallel to the x-y axis and not rotated, I came up with this idea. It works fine for me and hope this helps.

import bpy, bmesh

# These are the parts that you can change, inputs
step_size =            5
first_selected_loop =   0
x_or_y_parallel =      "x"

# Switching to EDIT mode to read mesh data
bpy.ops.object.mode_set(mode = 'EDIT')
bpy.ops.mesh.select_all(action='DESELECT')

# Program will get the zeroth index or first index of vertices 
# (that is x or y coordintes) according to your choice
if x_or_y_parallel   == "x":
    x_y_index = 0
elif x_or_y_parallel == "y":
    x_y_index = 1


# Getting the mesh data
obj = bpy.context.scene.objects.active
bm  = bmesh.new()
bm  = bmesh.from_edit_mesh(obj.data)

# Getting all line coordinates that is parallel to selected axis

# I am assuming we don't know how many lines we got in x or y axis
line_x_or_y_cords = []
for vert in bm.verts:
    if vert.co[1-x_y_index] not in line_x_or_y_cords:
        line_x_or_y_cords += [vert.co[1-x_y_index]]

# I am sorting the line coordinates and
# eliminating unwanted coordinates (we need only the lines that are on 
# step size by starting first_selected_loop)
line_x_or_y_cords.sort()
line_x_or_y_cords = line_x_or_y_cords[first_selected_loop::step_size]

# if the edge is not selected yet , if 2 vertex of that edge is 
#parallel to our expected axis and if one of its vertex is in our list 
# (that is arranged above) select that edge and do select loop 
#operation 
for edge in bm.edges:
    if edge.select == False and (edge.verts[0].co[1-x_y_index] - edge.verts[1].co[1-x_y_index] == 0) and  edge.verts[0].co[1-x_y_index] in line_x_or_y_cords:
        edge.select = True
        bpy.ops.mesh.loop_multi_select(ring=False)
bm.free()