Actually carriage return does not do an automatic "OK" response; in fact it triggers the "default" button for the form - i.e. the one in Red - the one that is first. So for example, if I define the button layout differently, I can get a different button to fire - one different from the OK button:
hiCreateAppForm(?name 'fred ?fields list(hiCreateStringField(?name 'jim)) ?callback "println(1234)" ?buttonLayout '(Empty (Defaults "println(5678)") (OK "hiFormClose(hiGetCurrentForm())") (Cancel "hiFormCancel(hiGetCurrentForm())")))
Of course, this example is silly - but you'll see that carriage return triggers the "Defaults" button rather than "OK" now. You could make that first button do something non-time consuming but still useful.