Do not use UID to do such a thing (my opinion).
Mark a Sprite with an instance variable, or an instance boolean.
Give Sprite an instance boolean 'Marked'. (in the layout, in its properties)
Make 'Marked' true for that very specific Sprite. (in the layout, in its properties)
Then: When we want to -- by example -- want to change the animation frame of the marked sprite when it is overlapping another instance of that sprite :
+ Sprite: Is overlapping Sprite
----+ System: For each Sprite
--------+ Sprite: Is Marked
---------> Sprite: Set animation frame to 1
--------+ System: Else
---------> Sprite: Set animation frame to 0
+ System: Else
-> Sprite: Set animation frame to 0