Helicopters and planes behaves different when they get a flyInHeight command. I tested the flyInHeight yesterday, because I'm making a cessna mission (yeah I know it's boring, but I like cessnas). This is my findings (after about 15-20 tests):
When given a flyInHeight command both helicopters and planes adjust their height relative to the terrain below (i.e it is height relative to the ground level, not sea level). If they are over open sea, it is height relative to 0 meters.
When moving they try to maintain this relative flyInHeight, but choppers are much better at doing so. Planes usually remain on the original height, even if a mountain gets in its way.
This has to do with speed. The faster the plane, the lesser its ability to adjust height. The same goes for choppers (but to a somewhat lesser degree).
I don't know how buildings affect choppers. It had no effect on my plane over Petrovice (but the plane is so fast and it's impossible to keep it fixed over a building for more than 0.5 seconds, so I really don't know)
Tested near the snowy mountains on Nogova with a BIS A-10 and a BIS UH-60. Observations was made by a regular BIS western officer with binoculars. It's almost like science, isn't it? ;D