You only show a little bit of the script and none of the "GOTO Paid Year (12)" script so I can't be sure but the comment line:
#The Last line of Goto PaidYear 12 is Commit Record.
would suggest the reason why this is happening. A commit records step will cause the layout to no longer have the focus on a row of your portal.
There are two possible "fixes":
1) Redesign your scripts so that the actions that cause the loss of focus do not occur
2) Save the portal row number at the beginning of the script (before focus changes) and use Go to Object, Go to Portal row, to return the focus to the original portal row at the end of the script. (Go to object is to put the focus on the correct portal should there be more than one, it only works if you use the Inspector to give your portal an object name.)
Thanks for the reply Phil,
As you can see from the commented code, I tried the 'collect the portal number, go to object method without success.
What worked was exiting script with Exit Script (0). Ba boom....
I see no such thing in your script.
The steps that do that have all been disabled and do not execute.
And I've used the method I've described myself successfully any number of times.