According to my tests the ID of terrain objects is always constant (even after game/mission restart), which enables users to find a certain terrain object directly using the alt syntax of nearestObject command:
_pos nearestObject _id
having a command that returns this ID directly without any awkward workaround would be extremely useful:
_id = getObjectID _obj