In layout setup (not on a button), you need to attach the script to a script trigger (OnLayoutKeystroke)
Your script that runs needs to detect the enter key being pressed. So your script would look something like:
if [ Code ( Get(TriggerKeystroke) ) = 13 ]
//Do your stuff
Note that detecting every keystroke is not WebDirect compatible, and has been known as a speed hit, so I wouldn't use it unless absolutely necessary. A wiser thing would be to set the tab order so that the user tabs to the enter button after filling out the form and can hit return to execute the button.
plus one for your "wiser thing to do".
Your first suggestion sounds like a good lab experiment - not something that you'd want to do in practice.
Get ( ActiveFieldName ) = ""
to the condition would make a bit practical.