I don't really get what exactly your code is supposed to do.
In any case:
uiresume
has to be placed somewhere in a callback of the gui you're opening, since you're above code stops running in the uiwait
line.
So, you might have an "Ok"-Button on your GUI with a callback à la:
function ok_button_callback(object, evt, handles)
fig = ancestor(object, 'figure');
uiresume(fig);
end