Okay, there are two ways I know of to PLACE an object at sea level, anywhere on the map. First one is to create a trigger ("emptydetector"), then setpos it to the [x,y] location you want. Triggers are always at sea level. The other method is to camcreate a game logic at [x,y,0]. For some reason, when you camcreate a game logic, it will be created (z) meters above SEA level, instead of above ground level. After you create it, setpossing it around will result in the usual (z) meters above ground level.
So anyway, with that said, you should create an object at sea level, right under your [x,y] target position. Then, create a game logic and place it at GROUND level of your [x,y] position (using setpos; remember camcreating it will make it start from sea level). Then, use the distance command to find the vertical distance between the two objects. Once you know this (the elevation of the terrain), then the rest is cake.