Another approach, if it is supposed to be a modal pop-up and there is no significant cost to canceling is to $dialog->bind('<Leave>', 'destroy'); so that it will go away if the user moves the pointer out of the window. I have used $menu->bind('<Leave>', 'unpost'); to produce context menus that remain up only as long as the pointer remains over the menu, which have been convenient for my uses.
I have not actually tried binding <Visibility> events, since I have not needed them in any of my programs yet. Does this need to work only for you or is this to be distributed? If it only needs to work for you, you might be able to configure your window manager to keep the dialog box on top and avoid the need for override-redirect.