Weird. I have mine right next to the stepper motors with the cables tight together, and I’ve never noted a false positive from my optical stops. Same with my 3D printer. The “Repeat” printer as designed by Ryan has the optical stops on the motor mounts for 4 of the 5 motors (3 for Z and 1 for Y – the X stop is not near a motor) and again, I have the cables zip-tied together with the motor cables right near the endstop, and have never seen a false positive. Maybe it’s a weakness of the CNC shield on the Arduino? I have it working on an SKR Pro 1.2, on an Arduino Mega 2560 with a RAMPS 1.4 shield, and on 2 of Bart Dring’s laser/pen controller boards, and also on a Duet 2 Wifi. Soon to be added to the list will be another SKR Pro 1.2, and possibly an MKS Gen L v1.0.
If you’re using an ESP32 already, you might want to consider something like FluidNC on an ESP32 driven board. That gives you the web-enabled control built in, and gets rid of the serial connection.
GRBL tries to buffer as many commands ahead as it can, as does Marlin, and for the same reason, so that it can plan ahead as to what to do with the motors, so that the machine does not need to come to a complete stop after every line of Gcode. If you wait for the command to finish before you send the next one, the machine will be very jerky when in operation, because the parser will have to assume that the machine needs to decelerate to 0 speed at the end of every command. This would really suck with sandify code, because as yet, I believe that sandify only sends short straight line commands to simulate arcs.
That said, I think there’s an “ok” response that the controller sends back when it’s finished a command, so you can sort of keep track of where it’s at in the real world.
For glass thickness, the top doesn’t matter, but for the bottom, the thinner you can make that surface, the better. Magnetic force decreases as the square of the distance, so having the magnet 1/8" away from the ball will have 4X the force of having the magnet 1/4" away. This means more ability to plough through the sand medium, being able to go faster and have higher rate turns. It means higher machine acceleration and overall smoother motion.
Personally, I would recommend a maximum of 1/8" or 3mm thickness. One of my Zen tables uses 1/16" whiteboard, which gets excellent results.