Select the SpriteSelection in the Layout to see that it has a new instance variable: SelectedUID. In event 2, add SelectedUID = SpriteUID. In 7 and 8 test for SelectedUID = Sprinte.UID. In 12, reset the SelectedUID, when you deselect.
You can do the same with a Global variable and without the selection, but then it isn't obvious which one is selected, and which needs the cursor over it to do the rotation. Your call.