I found this code and it was posted as a solution for a similar situation. Though, I don't know if this helps or how to even integrate this.
boolean alreadyRun = false;
void setup()
{
Serial.begin(115200);
}
void loop()
{
if (alreadyRun == false)
{
aFunction();
}
Serial.println("Still running loop()");
delay(1000);
}
void aFunction()
{
Serial.println("In a function");
alreadyRun = true;
}