It all seems terribly overcomplicated
The ISA model is quite simple and straightforward...
Metric: T = T0 - 6.5 (h/1000)
where
T0 is the ISA temperature (15C)
h is altitude in meters
T is the temperature at altitude h
Imperial: T = T0 - 1.98 (h/1000)
where
T0 is the ISA temperature (15C)
h is altitude in feet
T is the temperature at altitude h