I took a quick look at the code, correct me if I'm wrong, but for a PR it looks like you could directly move most of the logic to the GuiInterface.prototype.SetWallPlacementPreview method. I don't think length would be an issue since you largely rewrote the logic of that method anyway, which is itself already quite long. And I don't think anyone would mind having a bit more code for more desired behaviour. Also, that would make it even more performant because you wouldn't have to compute the entire entity state for each snap candidate and could pull values like the position from the simulation directly, which is a lot quicker. What do you think? I believe a lot of people (including me) would love to see this added to the main game.
Unlikely to be accepted as a PR.
It lengthen the code by a bit; and is probably not how one would go about to implement all of the different features I've added, without the constraint of trying to make it into a compatible mod..