I'm thinking of a bit different approach here.
Define a serial number field, onCommitSNField, and specify that the value be entered "on Commit". Then this field will store a value only if the record was previously committed (saved).
Then you can use OnObjectEnter on each and every field for which the layout/security settings allow editing to perform this script:
If [ YourTable::onCommitSNField]
Show Custom Dialog ["You are changing an existing record"]
If [ Get ( LastMessageChoice ) = 2 // cancel was clicked ]
Go To Object [ "put object name of button here to keep cursor out of data field"]
Note that it is also possible to use record level access controls set up in Manage | Security to control which users may be allowed to edit existing records. See "Editing record access privileges" in FileMaker Help and check out this particular sub section: "Entering a formula for limiting access on a record-by-record basis" for a detailed description of how to set this up.