You can set the visibilty to off when loading the figure:
fig = openfig(figfile,'invisible');
That should take care of the flashing.
And what is your problem using uigetdir? The result will either be emtpy (in case the user closes the picker), or will contain a path you can use as input to dir (don't forget to add '*.fig').