I've gotten as far as to make the squares, tile them and have control over the size, but I expected them to scale uniformly, but they distort as shown in the image provided. This problem doesn't happen if I use a value node. Is there a way to "pixelize" the texture that is inputted in the scale socket? To make it clear, the first image is what I don't want, and the second is somewhere near what I want
To get your squares to remain square, they must use the same evaluated brightness from the image across their extent, otherwise some parts of the squares will scale, or pass a threshold, differently from others. In other words, the image must be pixellated at the square-centers first.
(The illustrations below are not all shot at the same grid-scale)
Make a Grid .. This is just a different way from yours, no better..
It has 2 outputs: 'Cell UV' and 'Cell ID'
'Cell UV' maps each cell in XY, -1 to 1, with 0 at the cell center. 'Cell ID' colours the whole cell with the original, piece-wide UV at the cell centers.
Sample the Image, or your procedural texture, at the cell-centers, using 'Cell ID'...
..for a pixellated image. This image, on the left, has been gamma corrected and made negative for this particular, "printer's", way of making a half-tone...
The Half-Tone Screen, on the right, above, is made by making a 'Distance from Cell Edge'from the cell UV:
Combine: When the screen is multiplied with the image, put through a threshold, (and inverted again,) using a Color-Ramp, you get a traditional black-dots-on white half-tone.
If you do without the negative steps, you get white dots on black.
This example samples only one point for each cell, at the cell center. You could, say, take samples from a number of well-arranged points in each cell, and take their average, for more accurate toning.
I noticed that you moved your mapping node to avoid a mirroring problem with object coordinates at the axes. Working with generated coordinates you can create this node tree:
We run a modulo operation for the number of squares we want, we do some math to adjust the center of the coordinate space based on the number of tiles, and then run two compares into a multiply just like you were doing. I've just attached some value nodes with a multiply node on the bottom to make the slider action more usable on a small scale.