It would be simpler to list the matching records in a portal and then clicking a button in the portal row could perform your script to select that records Patron ID as the ID to use for all the records shown in the portal.
Portal filtering can use text you enter in a field above the portal to pull up just your records with similar addresses.
Does that sound like something you could get to work? Are you using FileMaker 11 (required for this kind of portal filtering here.)
Thanks once again Phil
Unfortunately we have a selection of FMP11, 9 and 8.5 so a 'portal-filtering' solution won't work, but the 'listing matching records in a portal' works fine - now I just need to work through the logic of merging and purging