If I recall correctly, you may still use "return" inside the brackets, if you indent and return a proper code:
https://adventuregamestudio.github.io/ags-manual/DialogScript.html#using-regular-scripting-commands-in-dialogs
https://adventuregamestudio.github.io/ags-manual/DialogScript.html#using-regular-scripting-commands-in-dialogs
QuoteIf you want to conditionally break out of the dialog script, the special tokens RUN_DIALOG_GOTO_PREVIOUS, RUN_DIALOG_RETURN and RUN_DIALOG_STOP_DIALOG are available which you can return from inside a script block