The first thing you should consider is using floats instead of doubles. This may speed up your code a little. You could also dispose the glTexCoord2* and glVertex2* with glTexCoord2v and glVertex2v, with this you pass only one parameter instead of two. A third optimization is to use vertex arrays or display lists and set the sizes using glTranslate and glScale.
It really depends on your GPU. For example, a shader-based solution on an openGL 3.0 GPU could simply store a heightfield and texture-fetch or vertex-buffer-fetch values based on x-y. Apart from that, and everything Godlike mentioned, a HUGE and simple optimization is to use triangle strips instead of quads(cuts down passed vertices to half). And do use vertex arrays(+vertex buffer objects if available), it IS a win!
Can you post good tutorials on how to use vertex buffer objects? And vertex arrays? Or can you post codes that has similar results with my code above that is more optimized than that?