Okay, so I've finished these bits of code and I think I now have a working test app that can effectively get GPS coordinates while my phone has no data or is in airplane mode (with location still on).
It relies on the work of @TIMAI2 here: 🟥 Location Services with HTML5 GeoLocation to more effectively/reliably obtain GPS coordinates while offline. I found I needed to extend the timeout period to at least 10000ms for my particular phone.
and a python script from Daniel Agar here: PX4-ECL/geo_lookup/fetch_noaa_table.py at master · PX4/PX4-ECL · GitHub where I modified this script slightly to just obtain sea level declination data table in 5-degree increments (in lieu of 10). This data is imported into the app as a CSV file. This will need to be periodically updated with app updates. If you want to use this yourself, you'll need to obtain your own personal NOAA access key (free, at least for personal use, and limits probably apply).
and the bilinear formula published by Joyanta Mitra here: How to Perform Bilinear Interpolation in Excel (Easy Steps). This is used to interpolate the above 5 degree declination data to get a more accurate reading on declination at the current location.
Thank you to all those who provided input here. I just wanted to leave this here for closure and to help anyone else in the community who wanted to utilise any of these three main items. Code attached.
Bilinear_Interpolation_V2.aia (17.5 KB)