You pose an interesting question. Don’t think I have an answer, but let me see where I end up as I try to reason through it.
Gen 2:15-17–The Lord God took the man and put him in the garden of Eden to work it and keep it. And the Lord God commanded the man, saying, “You may surely eat of every tree of the garden, but of the tree of the knowledge of good and evil you shall not eat, for in the day that you eat of it you shall surely die.”
Note that in Genesis 2 God gives Adam this direction prior to Eve’s creation from his rib. Another note I would make is that “you shall surely die” did not end up meaning immediate death, but mortality. I presume for Adam to have truly understood the consequences of disobedience he was able to understand the meaning of death, but not yet have a knowledge of good and evil.
Gen 3:1-13–Now the serpent was more crafty than any other beast of the field that the Lord God had made.
He said to the woman, “Did God actually say, ‘You shall not eat of any tree in the garden’?” And the woman said to the serpent, “We may eat of the fruit of the trees in the garden, but God said, ‘You shall not eat of the fruit of the tree that is in the midst of the garden, neither shall you touch it, lest you die.’” But the serpent said to the woman, “You will not surely die. For God knows that when you eat of it your eyes will be opened, and you will be like God, knowing good and evil.” So when the woman saw that the tree was good for food, and that it was a delight to the eyes, and that the tree was to be desired to make one wise, she took of its fruit and ate, and she also gave some to her husband who was with her, and he ate. Then the eyes of both were opened, and they knew that they were naked. And they sewed fig leaves together and made themselves loincloths.
And they heard the sound of the Lord God walking in the garden in the cool of the day, and the man and his wife hid themselves from the presence of the Lord God among the trees of the garden. But the Lord God called to the man and said to him, “Where are you?” And he said, “I heard the sound of you in the garden, and I was afraid, because I was naked, and I hid myself.” He said, “Who told you that you were naked? Have you eaten of the tree of which I commanded you not to eat?” The man said, “The woman whom you gave to be with me, she gave me fruit of the tree, and I ate.” Then the Lord God said to the woman, “What is this that you have done?” The woman said, “The serpent deceived me, and I ate.”
Though Eve was not created when the initial command is given to Adam, she repeats it back to the serpent so we know she is fully aware of the consequences. After the serpent tempts her with the potential gain of knowledge the fruit becomes more enticing: it is delicious, it is lovely, it gives wisdom. Previously it had not been a temptation. What about it being pointed out made it more tempting?
I’m not sure from what scripture says that we can glean that is was already an inner moral law that was dormant? But I wouldn’t say it contradicts it either. But it certainly indicates good and evil existed, but Adam and Eve were ignorant of the requisite knowledge.
Since Eve was not yet created when the command was given, but it did apply to her in the moment, we can assume that had there been any other offspring that ate of the fruit their eyes would also have been opened. What if everyone in your scenario had not eaten of the fruit? What then? Would some have the knowledge and others be ignorant/innocent? Would some be exiled from the garden while others stayed?
About all I can really say about those questions is…WAY above my pay grade! But fun to pontificate.