The Help for opendialog says:
The only way to close this dialog window is with the closedialog statement.
However, I just wrote a procedure that uses opendialog, and then closes it later with closewindow, and it is working just fine. The closedialog help does say we should use this instead of closewindow.
So, just quibbling over semantics.