Thanks for your bug report. This is a bit more complicated than I anticipated. The (Optional) text has always depended on whether the editbox has focus or not. But in the case of custom dialogs, scripts can modify the content whether the editbox has focus or not. The only way around this that I can think of is that if a script tries to modify the editbox in any way, the (Optional) indicator will be automatically unset. And if a script tries to get the contents, it will return an empty value. This change will be in the next beta.
Hi,
In my opinion, when I requested the addition of this condition, it was so that when the edit box is empty, the text (Optional) would appear, and when it is focused and the cursor is present, the text would disappear so that something could be typed. However, if you want to keep the edit box empty, the text (Optional) would still be displayed, but when you click OK, $did(name,id) would not return anything.