You can get all the UK height data (Landform Panorama) for free at 1:50,000 (50m) scale from Ordnance Survey Open Data. This will be much better than generating the height data from Google Earth. To get the whole of the UK, you can request the data on disk rather than use their download service (which is intended for small units of data). You can also download a load of other data for the UK for free from here.
EDIT: I should have said - two versions are available. You can get the Landform Panorama data as both contours and gridded point heights. The latter is very suitable for the easy creation of a raster DTM using (for instance) Gdal_Grid either as a stand-alone utility or as a sub-process from within your script (which could be useful for batch processes possibly in conjunction with gdal_merge or gdal_dem depending on what you need to do with the height map afterwards.