I suggest that you post your script.
To create a new record in the System table, you need to use New Record/Request before setting the fields. Since the last entry is modified, this could be related to the Relationships diagram. I suggest you post also the Relation defining the context for your script.
Fine, you have New Record/Request ... but you don't need Go To Record/Request/Page [Last] because you make the last record current, explaining you overwrite it. Add a Commit Records/Requests before the Go To Layout and you're fine.
There are two ways to fix the looping that you describe.
One is to use a global variable field to disable the trigger performed script temporarily. The other is to use a method known as "magicKey" to create your records and add data without changing layouts. You can web search on MagicKey to find a number of very good articles on the method.
To use a global variable to disable trigger controlled scripts, you can do the following:
At the beginning of a script performed by a script trigger:
If [ $$TriggersOff ]
In any script that might trip the trigger for the above script do this:
Set Variable [ $$TriggersOff ; Value: True ]
Put it before the Go to layout or other script step that trips the trigger for the script where you've put the If step shown above. Then put:
Set Variable [$$TriggersOff ; Value: "" ]
Later on in the script, making sure that it comes before any exit script, halt script and the end of the script so that you don't leave the triggered script(s) disabled. Also be careful during testing scripts in the debugger, not to leave this variable set to True or you may find these scripts disabled when you don't want to if you use the debugger to halt the script before the second set variable step destroys the variable.
Thanks for your suggestions.Which instance of Go To Layout are you referring to? And that doesn't solve the issue of the script repeating once the script sends the user back to the original layout.
I was talking about the last one.
Regarding the loop, it's caused by the fact that it's triggered by OnLayoutEnter. When you back to the original Layout, the OnLayoutEnter fires again and you get an endless loop. See philmodjunk comment to prevent that.
Thanks for the help. I will look into magicKey, but for the time being the Trigger variable is working.