Is there a specific reason you don't want to use tasks? They are made for these type of cases where you want a linear flow of operations. Either way, here is how you would handle this without tasks. The code sets up a callback for the accept button and calls a function when it is clicked.
Code:
import viz
import vizdlg
viz.go()
#Create empty dialog
dlg = vizdlg.Dialog(title='Dialog title')
dlg.visible(1)
#Link dialog to center of window
viz.link(viz.CenterCenter,dlg)
#Hide dialog and add gallery when accept is pressed
def DialogAccept():
dlg.visible(0)
viz.add('gallery.ive')
vizact.onbuttonup(dlg.accept,DialogAccept)