Genes have very clever techniques for optimizing their choice of companions, and optimizing their expression. Starting with micro-organisms: Upstream transcription factors are quite short and inexact matches are partially effective -- essentially an analog dial regulating the expression level. This is just the tip of the iceberg. I don't doubt that things are very much rigged so that mutations tend to be in some sense meaningful, coherent. Some micro-organisms actively edit key genes, this is especially common as a way to evade a hostile immune system. Eg malaria, gonorrhea. Bacteria also have a habit of picking up plasmids -- small chromosomes containing useful capabilities such as toxins.
Eukaryotes add some further tricks. Splice variants allow whole families of proteins to be produced from a single gene. Small tweaks in the sequence would allow meaningful biasing towards one or other member of the family. Multiple copies of genes are kept, and variants that are occasionally useful can be kept in reserve. Cross-over allows these to quickly spread through a population from a small reserve, and allows optimization to be carried out in parallel (a massive advantage eukaryotes have over bacteria).
I speculate that these mechanisms have evolved because organisms find themselves in environments that change over time, over and over again, therefore favoring quick adaptation. Haven't encountered a good popular account of these, nor even a rough mathematical quantification of their utility, nor an a-life simulation that abstractly examines this key feature of changing environment. But maybe I'm just not looking hard enough. Suggestions?