If you call Perform Find, records are displayed in UI. If you Go to record, it will display the record. You can't change record, if it isn't current. FileMaker always synchronize current record/found set and script. It is very hard to work with related record without switching layouts. It is slower than working with objects.
We need real OBJECTS in FileMaker for better scripting:
1) Object type FoundSet, that can be used in script
$fs = Get(CurrentFoundSet)
$fs = GetRelatedRecords ( "relation or portal relation", {current record} )
...
2) Object type Record
$records = $fs.First(10)
$record = $fs.Next()
...
$record = Get(CurrentRecord)
$record.GetField(...)
$record.SetField(...)
$record.Commit()
$record.Dump()
This will simplify record/foundset manipulation in script.
I do see the similarities between your idea and mine at: Programmatically Change TO Context
What you want here is right out of OOP as shown in other systems than FileMaker. I suspect that it would require a great deal more implementation to make workable than mine, but with the benefit of being able to more fully "decouple" scripts from the interface and be able to interact solely on the data level when that is needed.