But if this statement was actually true then Satan could not have possibly ever sinned in Heaven because God is there?
Same thing goes in the garden as well?
Again, the question comes down to: well, what is sin?
A lot of our Protestant brethren on the forums, well, I cannot say what they think sin is, aside from that which God dislikes. And for a Christian, that is a sufficient definition of sin.
But for someone who is trying to understand why sin is bad, such as yourself, such as myself, it will not do.
Aquinas did not begin with the question you asked - "What will prevent sin in Heaven?" - but whether God could exist, and what He was. Leaving you to discover Aquinas's five proofs, I will give you the results of his logic. Logically, Aquinas concluded, God must be something which 1) is the definition of existence, and therefore 2) must be "actual" - that is, as it should be, capable of being no different.
Also, as a result, time and space is very different for God than it is for us. He does not "choose" in the sense of moving back and forth between things, spatially or temporally, the way one might choose to sleep one hour in his bed and then eat the next hour in his kitchen 20 feet away.
So it is not possible for God, in His mode of existence, to be any different from what He Is. When we are "where" He is, so to speak, in His infinite, eternal Existence - for Existence is His defining quality - either we will share that, and will not be capable of being any different from His divine will (and ours with His), or we will hardly exist at all.
The difference between Heaven and Hell, is that in Heaven we are completely as we should be, and can be no different, for there, that is how things are. But in Hell, we will never be as we should be, or otherwise. We will be chasing an impossible lie forever.
Now, how the angels defected from God is a mystery to me. How they can be different from God when they are incorporeal is a mystery to me. But in the relation between man and God, the natural universe and God, this is what I learned from Aquinas.