Use Element.Group (clock works I think) and Object.IsNull. Element.Group will return the group the wall is in and null for walls not in a group. Object.IsNull will give you true or false that can be feed into a filter.
you can also see this post if you want to keep the groups as well.