Maybe you have to setup a scriptJob, that collects freshly selected UVs (in a storage of your desire: attribute at your object or global string[]) at selection.
But that whould mean, that you'd have to explicit start collecting..
ok I did something similar in my moveScaleSew . (Its a small tool to use the standard Move And Sew feature from Maya without the distortion that occurs if the sewed edges are too different... but it works only with one edge and has no idea of what shell moveAndSew will move...)
For the automatic mode in moveScaleSew there is a scriptJob that executes a command in a variable at every selection change:
So I can modify the command as I wish depending on where the user is in the workflow.. But of course you can put any command in there. The -parent flag is used to attach the scriptJob onto a specified UI. This way its automatically deleted if you kill the UI. Otherwise you have to remember the ScriptJob ID and kill the ScriptJob later...
Now the -event flag is impotant for you: The string written thereafter describes what executes the second string. There are dozens of events. "SelectionChanged" is a very common for scriptJobs.