Move Start- and/or endpoint of Model Lines if they those points are duplicate

Hello everyone,

I have a design with a lot of Model Lines, generated from alignments. These Model Lines have duplicate start- and/or endpoints. Seen in the image below:

The problem lies not with the moving of these Start- and/or Endpoints if there are only 2 duplicate points per line, then i would move one of these points by 0.5 meters.
But when a third line appears it should be moved by 0.5 + 0.5. This should scale up so that for every duplicate point that is added, they should move by 0.5 more. I have drawn this below:

(These Circles represent the new Start-/or Endpoints

Code which i have so far:
22-01-2020 Move Duplicate.dyn (68.7 KB)

Thanks in advance!