It seems like there should be some way to identify the z value of the terrain surface at any particular coordinate.

like

z = ent_terrain.surface;

Wouldn't that be nice?