I'm not sure that's what's happening. Particle.connect() is partially non-blocking; it can return before the connection is complete. Make sure you are not repeatedly making those two calls; you probably need to set a flag to make sure you don't call them on every loop.
WiFi.hasCredentials() runs on the system thread, so it will block the main thread until the system thread is free to handle it, which may be part of the problem as well.
What you are trying to do is definitely possible; you should see how it was done in the library in this post which is known to work.
Also make sure you're not doing a Particle.publish() when in the disconnected state elsewhere in your code. That will block its calling thread and the system thread.