Just my preliminary thoughts on how an angel so close to God could have fallen. I bear no illusions of the inerrancy of my statements.
Question: Basically, Satan was an angel in heaven who decided to rebel against God. He knew that God is omnipresent, omniscient and omnibenevolent. How could he be stupid enough to do that?
Answer: Knowledge of God’s power, knowledge and character does not make it impossible that someone (however smart) would rebel against God. Think of what rebellion means. It means that some creature decides that he would rather have things his way than God’s way. He realizes that he likes his way better. This does not appear to have anything to do with one’s knowledge of God’s power. You could know that God is more powerful than you and still decide you do not like the way He runs the world. This alone might not create in you the illusion that you could best God in a fight, though.
It also appears to be independent of one’s knowledge of God’s omniscience. Once you decide that you like your way better than God’s, you have decided that God is not omniscient. i.e you know how to run the world (or your life or both) better than He does. Rebellion is therefore incompatible with knowledge of God’s omniscience. One could theoretically go from believing God knows best to believing ‘I know best’. That itself is the act of rebellion. The same goes for knowing God’s omnibenevolence.