Glad that I could be of use.
Remember that AM assumes perfectly dark skies, with minimal light scattering due to atmosphere (i.e., for practical purposes you can pretend that there is no atmosphere assuming no competing light sources).
Once you get into the stratosphere and above, not only is curvature of the earth more obvious, but the skies above will be a bit darker with even less atmospheric scattering while the skies below will have a bit of extra luminance due to the angle of sunlight/moonlight striking the thicker air in the troposphere.
IIRC, atmospheric density, hence Rayleigh Scattering, is a more-or-less linear function of altitude. Create an invisible sphere for the atmosphere which extends to approximately the altitude of the ionosphere. Then base luminance/illuminance of the atmosphere on altitude plus a chord defined by the points where light strikes the atmosphere vs. where it "exits."
Not only will that give you the cool "sky glow" effects due to light passing through the atmosphere as seen from very high flight/LEO, but it will set up accurate sunrise/sunset and AM of celestial objects effects as seen from altitude. It would also lay the basis for aurora effects which originate at the ionospheric level and get a certain amount of their cool glowing effects from Rayleigh Scattering.