You can use waitfor in the main function and provide the handle of the uifigure.
H = uifigure;
WindowAPI(H, 'enable', 0);
WindowAPI(H, 'enable', 1);
You can disable all elements of the uifigure manually: Store a collection of all handles you want to disable in aa variable. Then set the 'Enable' property to 'off' and add a message, that the window is locked until the other is finished.
Actually using uiwait should work suffciently, if the other window is 'modal'. Unfortunately I do not see a way to create a modal uifigure. But if the 2nd GUI is opened through a callback of the 1st GUI, setting teh 'Interruptible' property of the 1st GUI to 'off' and the 'BusyAction' to 'cancel' should ignore all interactions with the 1st GUI, when it waits to waitfor inside the callback.
Another idea is to set a flag in the GUI's UserData, which is checked in each callback, as long as the 2nd GUI is open:
function CallbackOf1StGUI(H, EventData)
GUI1 = ancestor(H, 'uifigure');
GUI2 = OpenGUI2();
GUI1.UserData.Locked = true;
GUI1.UserData.Locked = false;
Add the test of the locked GUI in each callback.