This seems to be one of those questions where, if all the information given is true, you kind of need to know God's outlook to understand the answer. It could be that God only knows what is in creation; that it is impossible to know the future, so He is sort of guessing at what would work for a "good" creature. Perhaps He doesn't think knowing everything all the time would be very interesting (which it probably wouldn't) so, although God is omniscient, He needs to think of a question, and then He knows the answer; like keeping His mind partially separated from His knowledge. I believe the more religion oriented answer, though, is that God does know everything, and when He made us, He made us imperfect on purpose. Maybe, since He gave us free will, He wants to test us to see what choices we make, knowing all the while that, if, and when, we make bad decisions, we can always come back to Him after repenting.