In the end, instead of trying to write a one-liner, I wrote the following function which does what I need.
def find_plans()
model = Sketchup.active_model()
s = model.selection()
s.clear()
ents = model.entities
non_horizontal_edges = []
for e in ents
non_horizontal_edges.push( e ) if e.typename() == 'Edge' and (e.end.position.z - e.other_vertex(e.end).position.z).abs > 1
end
ents.erase_entities( non_horizontal_edges )
end