Grid material that extends with mesh? For clarification, I am trying to create a Supergrid:

Put a 2m x 2m grid texture on a mesh.
When I move or scale the mesh, the grid will increase as the mesh does
(the 2m x 2m does not stretch or distort, but instead increases the number of lines which represent the 2m grid)
The grid is shown equally on XYZ faces of a mesh.

A bonus would be changing colors, as boxing out a whole level in one color could be confusing.

Details:
I was trying to set up a grid material(s) for blocking out game levels.
A short effort to make a simple material seems to have drained my day without a solution,
if anyone could help I would greatly appreciate it.
Something similar or exactly like Supergrid for UE4.
Skip to 1:10 for basic function.
https://m.youtube.com/watch?v=NxUq_rD8PVM#
I was trying to use a grid node created by Anton Nevesolv.
https://m.youtube.com/watch?v=gsZoJBeAWGc
Though, this might not be ideal for creating the desired results?
If we take the above grid and use it in a cube material node,

then attach the Object socket of a Texture Coordinate node to the vector of the Grid node,
then use the eye dropper on the Texture Coordinate to assign a plane as the mesh that will represent the ground of a level,

This seems to work similarly to what is happening in Supergrid for UE4.
However, the sides of the cube becomes lines instead of a grid.
The same things happens if you use an image of the grid.
However, if you change the texture coordinate from Object to UV, we get a nice grid on all sides of the mesh, but now it wont slide in relation to the ground plane, and it also distorts when scaling the mesh.
Any help would be greatly appreciated. I have been trying for hours and I don't see a solution in sight.
This will work for mesh with planar surfaces aligned to the world axis.
That can be this kind of settings, based on world coordinates as input:

It adds the object location to object coordinates so that the result is sensible to the mesh location. Then, it takes a cross product with the normal, in order to avoid limit values to appear when calculating the grid (you'll can test the difference, using it or not).
The grid itself is just a comparison to some value, of the fraction part of the scaled coordinates. More precisely, if the value is around 0.5 (again to avoid limit cases we may encounter if comparing to 0 or 1).


Edit

If you want the grid to be stable from the object position, change the input like that (the object location is substrated from the surface location in world coordinates):

Is you want the grid to be aligned to the object (if its origin is in a corner), change the node group shifting it 0.5/scale (see below on left).
And to avoid limit cases, keep only one positive test (below on right).

Updated blend file: