Bring all planes in mesh to same level
Switch to object mode using the tab key, then press SZ 0 to scale the model to a uniform value on the z axis.

The result is that the selected region will be scaled to the median of all the selected vertices, effectively flattening the selection.