The expression to be evaluated when a dialog is called is given as Out[$Line] of the dialog, wrapped in HoldForm. The expression can be seen by asking for % when the dialog is first started.
Any value returned from the dialog is discarded.
TraceDialog[
expr
] returns the result of evaluating expr.