You start by creating a module which opens a modal dialog. The way this has to work is that module opens the dialog by means of a simple after processing branch going to "Page or URL (redirect)" which points to a page item that contains the URL to go to. In my case, it's &P0_TEST. This page has a before header process which sets P0_TEST to be a simple URL with &DEBUG. in it, i.e.