As temperatures increase over 70degC scalable spark and fuel enrichment is required to help decrease the knock window. Spark needs to be retarded as IAT increases, a simple scaling table would be sufficient.
Increasing IAT directly effects the likelyhood of knock, when IAT increased the advance needs to be reduced in order to decrease the likelyhood of knock.
If you assume that the normal operating air temp is 30-50 degC then you'd want to run with a constant enrichment value 30-45, 45-60deg you'd take fuel out because of the drop in air density. 60 up you want to start adding more fuel.
The same also applies to coolant temp.
Perhaps as an extension to the Warm-up enrichment a cool down enrichment