Improving generated script by EditText function

Modified the Type function (EditText) so it doesn’t generate
unnecessary script when users click on “Cancel”
or on “OK” without entering any value/text