In my opinion the decision whether to show ok button because your loaded in a subpanel need to be moved to the caller of the VI. So you would have an input in the VI that say Run mode:
1. Run mode as regular top level, you show ok and cancel button and do normal event monitoring on the ok or cancel button. You can event set this as default value, so if you want to run it as regular VI, say in debugging you can just run the VI.
2. Run mode as subpanel, then the caller should pass a user defined event that is fired when the main VI window exit button is pressed. Also when VI is run as subpanel, you should hide the ok and cancel button. So your terminate signal can either come from the ok and cancel button or the user defined event, in either case there will be only one active scenario at all time.
This answer might come a bit too late but there will probably be others which will need the solution.
You read the VI property Front Panel Window:State and then the property Front Panel Window:Native Window. If the state is Standard, Minimised or Maximised (which means that the front panel is open somewhere) and the native window handle is 0 (there is no win32 window) then the VI is in a subpanel. It's only in this situation that the VI doesn't have a window (in the Windows win32 sense).
please could you post an example vi with this property node, it would be useful, thank you!