Why use For Each here?
Imagine you're running your code on a stack of paper. 100 sheets.
For Each: You pick up the stack and select a single sheet of paper. This is the sheet you're going to run the rest of the code on. (You will do this for every single sheet of paper in the stack, one at a time. This is what For Each means)
Pick Top Instance: You look at the sheet of paper in your hand and check to see, out of all the sheet(s) of paper in your hand, which one is on top. Since you only have one sheet in your hand, the top instance is automatically the one in your hand. This is why your code doesn't seem to care about what's on top and what isn't. To your code, every single sheet is on top because it's only being compared against itself
Here is one way you could do what you're trying to do:
This basically deselects ALL objects every tick, and then only selects objects that are both:
1. Being hovered over by the mouse
and
2. Are at the top of the stack being hovered over by the mouse
Let me know if you have any questions!