Hi dan
Lots of good posts with the scripts and I am learning too.
I just thought of another way to consider. This really only works well if your grid has square cells thought (does not cover all your needs)
1) Make each cell in your grid a single pixel. Under menu item "View" you turn on the pixel grid. I created your example and it looks as below as a 43 x 64 pixel total size. Note that you can draw with the pencil at a pixel level with no selection required. Also, selecting subsets of individual cells is quite easy and a number of ways of doing so. Also, if you are using the exact same color in all the like cells, they can all be easily selected and color changed with the magic wand and a Fill command
[ATTACH=full]110009[/ATTACH]
Here is what is looks like without the pixel grid turned on:
[ATTACH=full]110010[/ATTACH]
2) You might say great yet that is not the size I want or need and also I need cell borders put in. No problem
Use Image > Image Size and increase size by an integer size (I suggest some multiple of 1000%) and set the rendering algorithm to Nearest Neighbor. This does an excellent job of upsizing grid type patters. The Image Resize panel is shown below:
[ATTACH=full]110011[/ATTACH]
And here is the result after a 1000% size increase up to 430 x 640 pixels:
[ATTACH=full]110012[/ATTACH]
For the grid, I created another Layer and did a pattern fill with a pattern that was 10 x 10 pixels with black border and solid white interior show in lower right corner of the Fill Panel.
[ATTACH=full]110013[/ATTACH]
That creates a pixel grid per the image below:
[ATTACH=full]110014[/ATTACH]
Changing the above grid color would be easy again with selection by magic wand.
By making this grid Layer set to Blend of Darken, you get the final result below (grid street is 2 pixels side)
[ATTACH=full]110015[/ATTACH]
Note that the tone appears to be darker yet that is just the effect of having an adjacent dark grid.
Just another way to consider to get the job done.
John Wheeler