the code for the dialog would be best to be put inot own cpp file, having a own header file. most propably.
The execution line you were showing opens the dialog. Usually in resources the dialog are defined to be modal and waiting, so execution in calling cpp file stops into the point untill the dialog is dismissed. Basically since the symbian os is event driven, and you are propably opening the dialog after user selects a menu command etc. , so maybe you could first try putting the code into the place where the event is handled (i.e. command handlers etc).
Maybe you should also investigate the implementation issues from example applications as well as from the open source projects freely available from the internet.