How to get enclosed spaces from a series of connected nodes
One approach is to use a data structure for representing a planar graph.  Each node corresponds to a vertex in the graph, and each walls corresponds to an edge in the graph.  Then, you are looking for the set of faces in this graph.  Standard data structures for representing planar graphs should make it easy to retrieve the set of faces.

For instance, one standard data structure is the DCEL data structure.  It explicitly contains one record for each face, so once you have converted this to a DCEL data structure, then it is straightforward to iterate over all faces.  There are standard algorithms for constructing a DCEL data structure from the set of vertices and edges.  Or, instead of a DCEL, it looks like you could alternatively use a quad-edge data structure or a winged-edge data structure.  The keyword is to look for data structures for polygon meshes.  This has been studied in great detail in the computer graphics and computational geometry fields.

Alternatively, you could solve your problem directly.  For each node, find all of the walls associated with it, sort them by their angle, and store that sorted list associated the node.  After doing that for all nodes, then you can iterate through all rooms.    Pick an wall, then you can find the room to the "right" of that wall by simulating the left-hand rule: stand to the right of that wall, put your left hand on the wall, and walk forward, going in a circle around the perimeter of the room.  To simulate that rule, as you walk forward, you'll walk to the endpoint of the current wall; at that node $d$, to find the next wall you proceed to, look in the sorted list of walls incident on $d$, and find the next one in sorted order, then follow that wall.  It might be a bit trickier to work out the details of this, than to use an existing implementation of a DCEL data structure.