Using python to create freestyle line groups
To mark a freestyle edge use MeshEdge.use_freestyle_mark 

Here is some pretty ugly demo code to select every second line of edges in the x direction, that works because mesh is aligned x, y. 

import bpy
import bmesh
from mathutils import Vector

context = bpy.context
mesh = context.object.data
N = 30
TOL = 0.0001

# clear all freestyle mark edges

for e in mesh.edges:
    e.use_freestyle_mark = False

def edge_by_value(e, axis, value):
    v1, v2 = e.verts
    return getattr(v1.co, axis) == getattr(v2.co, axis) and abs(getattr(v2.co, axis) - value ) &lt; TOL

bm = bmesh.new()
bm.from_mesh(mesh)
bm.edges.ensure_lookup_table()

x = -3
while x &lt; 3:

    edges = [e for e in bm.edges if edge_by_value(e, "x", x)]
    print(x, len(edges))
    for e in edges:
        mesh.edges[e.index].use_freestyle_mark = True
        mesh.edges[e.index].select = True # selected 
    # every second edge
    x += 2 * 6 / (N - 1)

mesh.update()


Running with this line of code

    edges = [e for e in bm.edges if edge_by_value(e, "x", x) 
               or edge_by_value(e, "y", x)]




Probably a better approach is: if you know the index order of the edges, would be using row/col integer modulus and div on the edge index.