This script trips its own script trigger. Thus, it does all it was programmed to do, going to the last record, but then Go to Layout ["Location" (Location)] trips the OnLayoutEnter trigger and this script is performed all over again, trapping you in an infinite loop.
This is one of the issues prompting a recent submission by me of a long list of changes I think should be made to improve this product: http://forums.filemaker.com/posts/56b3613440
First, if all you want to do is make the current record on the "Person" layout the last record in its found set, use Go to Record/Request/Page [Last] and you no longer need the loop.
Second, you can keep this script from getting trapped in an infinite loop if you modify it in this fashion:
If [ Not $$TriggersOff ]
Set Variable [ $$TriggersOff ; value: True ]
Go to Layout ["Person" (Person)]
Go to Record/Request/Page [Last]
Go to Layout ["Location" (location)]
Set Variable [$$TriggersOff ; value: False ]
I almost always enclose all trigger performed scripts inside such an If block--all checking the value of the same global variable ($$TriggersOff) so that I can set this one variable to True whenever I want to disable all script triggers in my solution.
Thanks for the help Phil!