I suspect that the dialog is open BEFORE the sort is performed and you have to click the Sort button to initiate the sort and close the dialog.
If so, there's a "perform without dialog" option you can specify for the Sort Records script step that will keep this dialog from appearing and interrupting your script execution. Open the script in the script editor, click the sort records step to select it and then look for a check box for this option down at the lower left corner of the editor.
That worked PERFECTLY. Thanks!!!