Hey Catharine.
Not sure if this can work while code is running but an idea.
I use this in browser forms since their are no message boxes.
Use a section or text field which is hidden most of the time. I often will make it in red or soemthing that will draw their attention to it. Also put it clode to the submit button.
But unhide it and then rehide it again. Create a field in your form called hide. Default it to true. Make the section conditionaly hide when the hide field is true. When the user clicks set hide to false. At the end set hide back to true.
I think this could work if the form will refresh while the code is running. Should be simple to test for you.