Sure, gather round and harken to my diagrams.
First the spawner locates all the nodes located four nodes plus and minus from the player's node in both X and Y directions. The said nodes are indicated by a shaded zone in the following screenshot:
Next the spawner checks the collision class of each node in the shaded zone and eliminates any non traversable nodes:
Then it chooses a random node from the remaining choices and spawns an enemy there.
Also, when an enemy exists six nodes in any direction from the player's node, the enemy despawns, freeing up the NPC slot for another enemy (which will spawn nearer to the player):
In this way, enemies won't just spawn in a far away corner and make the room feel empty. Neat huh?