That feeling you're describing - where you just can't get it out of your head - I know that one well. It's like your brain keeps going back to it because it knows something was off, even if you can't fully explain what.
What colour was it roughly? And was it making any sound at all? Those two things tend to narrow it down a fair bit from what I've read on here.
I'm not far from Dundee and we get the usual suspects people try to explain things away with - drones, chinese lanterns, the odd helicopter doing something weird. But hovering over a treeline with no obvious movement, that's a different thing. Drones drift slightly, lanterns definitely drift. If it was just sat there that's the bit that would get me.
Post more details when you can, even small things you might think are irrelevant. Sometimes its the little stuff that matters most. Other people here have had similar and might recognise what you saw.