While I do not believe there is a direct way to do this in the API, there is a cool trick with Springnodes.
Essentially, you need to try to get the sketch of the walls with Springs.Collector.ElementSketch
. This node will output an empty list if there is no sketch, (the wall has not been modified). We can then use this logic to filter the list of walls.