I think expected behaviors for windows and dialogs are being mixed here.
A window I wouldn’t be able to dismiss with Escape but would expect it the reset the field and lose focus. Enter wouldn’t close anything but would submit the value only.
In a dialog Escape would instantly close it and Enter would submit and fire of the default = true
event.
Now it comes down to what we use the editor script UI for, some might be building something that they would like to behave like a Window, and others like a dialog.
The safest is definitely to try to support both expected styles.
The only thing missing to be able to support both is that if a button has a default = true
then Enter is only consumed if the field could receive and render and a newline character. If newline are not possible it should submit the value and fire of the default event.