PeteS160:
could you provide a bit more of the code I could look over to see how it worked with the rest of the sketch?
It's important to know whether your sketch needs or tries to be non-blocking before we get into that. Can the program "sit and twiddle its thumbs" while waiting for an AT response, or does it need to be servicing other tasks during that time?