Halt function midway until player presses 'OK' then continue

I’m constructing a tutorial function that runs through a series of events and will occasionally put an ‘OK’ popup on-screen that the player will confirm before the events continue.

What’s a good way to pause this function’s process while waiting for the player to ‘OK’ the popup?

You should use Coroutines for that, for example:

private bool isOkay = false;

void Start(){
    StartCoroutine(PopMessage());
}

IEnumerator PopMessage()
{
 // PART 1: do something here
 if(isOkay==false) yield return; // function will wait while isOkay is false
 // PART 2: do something after isOkay is true
}

void OnGUI() {
// when you click the button, function PopMessage will continue to PART 2
if(GUI.Button(new Rect(0,0,100,50),"Set Okay to True")) {
isOkay = true;
}