I’d start with 2DGridExecutionMacro for the grid, just type that in youtube to understand how it works. You basically spawn hISM/ISM/any other actor/component in that grid and get (whatever you want basically) out from it in an array. From there on, it’s just iterative logic from array indices (give them 2D vectors as coords if you want since you want - i pressume a 2D grid.
For snap, you just do get location under cursor by channel (or make ur own line/object trace) and use either snap to grid (float) or snap to grid (vector).
Basically, just type “UE4 2D Grid execution macro” & “UE4 snap to grid” into youtube and Mathew Wadstein will explain them simply with examples
Hope it (still) helps, glhf!