You either set it up to only create the sprites if the space is free or remove the duplicates after.
One way is to use an array to keep track of occupied spaces.
start of layout
— set array size to 1000,1000,1
— for each island
— — array set at island.x/16, island.y/16 to 1
— for each island
— — array at island.x/16+1, island.y/16 = 0
— — — create wall at island.x+16, island.y
— — — set array at wall.x/16, wall.y/16 to 1
… same for other directions
You could also use a tile map instead of the sprites for similar results. Probably could end up simpler.
Another idea is to clean up the duplicates after.
start of layout
For each island
— create wall at island.x+16, island.y
— …other directions
Start of layout
Wall overlaps island
— destroy wall
Start of layout
Repeat wall.count times
Wall: x=wall(loopindex).x
Wall: y=wall(loopindex).y
Repeat wall.pickedCount-1 times
Pick random wall instance
— destroy wall
At least those are two methods. Another could be to store xy pairs of created walls in a dictionary and check if a location is listed before creating.