You can use a layout based script trigger for this: OnRecordLoad.
The trigger can run your script that determines which layout to select for the current record. On each layout where you set this trigger, clicking through the records will automatically trigger the script.
Be careful, layout based script triggers may affect the function of other scripts in unexpected ways. If you have another script, for example, that uses the same layout to move from record to record, it will also trigger OnRecordLoad events which will, in turn, trigger the same script.
Beautiful solution, thanks so much for your prompt reply Phil, much appreciated.