I'm not very good with dialogs, but shouldn't:
If ($Dialog(sbar)) { Dialog -x Sbar Sbar | Dialog -m sbar sbar }
be
If (!$dialog(sbar))
to check it's not open?