UV Islands. how to distinguish them? If somebody knows:
when we pick two points on UV image and search for shortest way in 3D, than return selection of shortest path to UV, we have problem, that selected vertices not only from initial island, but also all vertices that share same points in 3D mesh. So, question to deselect other islends that not selected initially...

for f in bm.faces:
  for l in f.loops:
    luv = l[uv_layer]
    if luv.select:
        #???how to remember the island, then to return to it? Direct Link not suitable
        luv.uv = l.vert.co.xy
Isn't this simply how 'uv select sync' currently displays things rather than being a coding issue?

The only way to do this would be to disable 'uv select sync' and change the 'Sticky select mode' to 'Disabled' in the Image Editor header, as shown below:



The disadvantage is that the whole mesh will have to be selected to appear in the uv image editor. I'm not sure if this helps or not because I don't quite understand what you're looking to do, but thought I would add this information in case it does, seeing as you don't have any other answers.