Hmm.. better just make sure you understand what the .seltext property is for: It is to return the text in a given ID which has been selected (highlighted).

eg.
Code:
dialog blah {
  option dbu
  size -1 -1 120 80
  edit "Hello", 1, 10 10 100 10
}
on *:dialog:blah:close:*:if ($did(1)) echo -a Text: $+(04,$ifmatch,,$chr(44)) Selected text: $+(12,$did(1).seltext)


If you just open the dialog with /dialog -m blah blah and then close it again it will simply return:
Text: Hello, Selected text:
Now open it again, select some of the text and close it and you'll get something like:
Text: Hello, Selected text: ell

If you change the $did(1).seltext in the code to $did(1,seltext) you'll see that both parts will always return the same value.

Your dialog code might not work, I didn't check through it for errors. But I can say that I'm confident that $did(n, seltext) will never behave like $did(n).seltext does and that $did(n).seltext will always return correctly for selected text.