You can achieve this without a script by setting up a default user Account and an associated Privilege Set that does not allow record creation (or deletion) for a specific table. See the menu item: File|Manage|Accounts & Privileges.
I attempted to do this last night but could not work out how to make the user account default. how is this done please?
See the menu item: File|File Options…
Check the checkbox labelled "Log in using:" and the radio button called "Account Name and Password". Then type in the default account name in the Account: field and the corresponding password in the Password: field.
Remember to launch your file holding down either the shift key (Windows) or the option key (MacOS) if you want to log in using your admin password.