I use something similar to:
(setq show T)
(setq var "34")
(while show
(setq show nil)
(on iniciate dialog put value var into dialog)
(show dialog) -> into the dialog a put function to close dialog or if necesary (close dialog, select elements point whatever... and put show to T)
if var change when dialog appears the new value of var is correct.
)