Satan first introduced evil in the heavenly realm.
When was that moment? When was evil introduced in the heavenly realm?
We know definitively that evil was introduced in the heavenly realm before GOD planted the Garden of Eden.
8 Then the Lord God planted a garden eastward in Eden, and there He put the man He formed. 9 Besides this, God caused every tree beautiful to the sight and good for food to grow from the ground. Also, in the middle of the garden were the tree of life and the tree of learning the knowledge of good and evil.
(Genesis 2:8-9 OSB)
When GOD made the Garden of Eden, He planted the tree of the knowledge of good and evil in that garden. In order for GOD to plant a tree involving knowledge of evil, if GOD is not the inventor of evil, then it follows that evil must have already existed at that point. And since evil itself had not yet become a part of the human earthly creation, then evil must have been restricted to the heavenly realm.
But can we be even more precise regarding the timing of sin's origin? I think we can.
The Bible tells us that sin originates in the heart. As Jesus explained:
11 What goes into someone’s mouth does not defile them, but what comes out of their mouth, that is what defiles them.”
17 “Don’t you see that whatever enters the mouth goes into the stomach and then out of the body? 18 But the things that come out of a person’s mouth come from the heart, and these defile them. 19 For out of the heart come evil thoughts—murder, adultery, sexual immorality, theft, false testimony, slander. 20 These are what defile a person; but eating with unwashed hands does not defile them.”
(Matthew 15:11-20 NIV)
For Satan to behave evilly, he must have first thought evilly.
We previously established that GOD gave the heavenly creatures a specific role in the operation of the universe. As a creature of the heavenly realm, Satan, too, would have had a specific purpose.
At some point in the beginning, Satan thought he could have more than he was given. He could restructure the operations of creation. He could make things work according to his own will. And in so doing, he could elevate himself to the position of GOD.
Many people believe that GOD addressed Satan's prideful attitude in Isaiah's prophecy:
12 How you are fallen from heaven, O Lucifer, who rose up in the morning! He who sends for all the nations is crushed to the earth. 13 For you said in your mind, ‘I will ascend into heaven; I will place my throne above the stars of heaven. I will sit on a lofty mountain, on the lofty mountains toward the north. 14 I will ascend above the clouds; I will be like the Most High.’
(Isaiah 14:12-14 OSB)
Regardless, we can deduce that Satan invented evil by developing a prideful heart in the heavenly realm after the completion of creation and before the planting of the Garden of Eden.