The texture change on savemap is a bug in the engine, but not one that can easily be fixed or even automated. It has to do with multiple different textures in close proximity of each other (and the way the engine tries to block textures together to save video memory I would guess), and yes heightfields do increase your chances of running into this bug. Manually fixing it involves making a larger than needed selection of cubes and changing them to the desired texture, saving the map and hoping that it doesn't glitch again. Trying to script a tool that would automatically fix these would be nearly impossible, because each one will probably be unique and require different selection sizes and what not. Even detecting where these errors are would be close to impossible to automate.
Some things will always require a human's touch when it comes to map making, this being one of them.
Some things will always require a human's touch when it comes to map making, this being one of them.