Line 215 of agent.py sorts the APs and discards whitelists, I think that would be a good place to break off and upload the data.
I guess set a threshold of how often you upload, maybe once an hour. Then zip all the new stuff, and ftp to a known address on your local network and put the file then maybe remove the local zip?
With a wlan0 entry in /etc/network/interface.d/wlan0-cgf you can set it to dhcp and to use wpa_supplicant
Real quick script to up the interface:
wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf
Then tearing it down is as easy as
ifconfig wlan0 down
At this point you could return back to processing the APs where you left off.
I'm not sure if processing the APs is time sensitive and running this section could take a few seconds depending on amount of capture
This would also alleviate the "neighbor-hole" and once an hour you would lose them, but only for maybe 30 seconds, and only if your capture threshold is met
I'm going to work on a plugin that fulfills this, allowing the user to any amount of time (0 for infinite) to remain in managed mode. Thus allowing ssh from specified network for unlimited time, or just a quick upload of data to server and maybe update grid if enabled.
I'm not sure exactly what the next steps are but once I get it working I'll figure out how to attach it to this issue request.