Figuring out Particle.disconnect() and WiFi.off()

You need to have WiFi.on() and I’d try WiFi.scan() for WiFi only and WiFi.ping(someOmnipresentIP) for internet and cloud access and when availble call the respective xxx.connect() function.
I’d also suggest SYSTEM_THREAD(ENABLED) and SYSTEM_MODE(SEMI_AUTOMATIC) as @peekay123 already did.