Thanks for the response, I think I am getting there now! I am stuck on two things though.
I have used the raycast node to delete points outside the mesh, then further deleted them based on a voronoi texture. However when I extrude them into a wall, it is no longer a grid and there are not enough subdivisions to use raycast like before. I think the picture helps to show what I mean. Is there a way I can subdivide only the vertical lines?
Secondly you merged points on the edges of the floor and walls to remove the blocky look, I have no idea how you achieved that, could you give some insight? Being able to have a selection of the borders of a mesh seems very useful.