My answer leans heavily on Augustine's conception of God in his Confessions, as well as the freedom of the will in On the Freedom of the Will, and, less so, on Plato's dialogue Euthyphro; direct quotations are available once I return home and find my copies of those books.
if you follow my orders you will go to heaven, otherwise you will go to hell would be the mark of a good and just God if and only if we had the free will to either follow or not follow orders. Now if God were not perfectly good and just, God wouldn't be God, but rather just some superpowered dictator and craftsman. Presumably this isn't the case.
So there are two possibilities: either we don't have free will, and we aren't actually subject to punishment, or we do, and we are. Presumably again we do have free will. There are a variety of arguments for that; see this for starters.
The problem, then, is: in what sense does God have a plan for us, and how is this foreknowledge compatible with our free will?
What does it mean for God to have a plan? In general a plan is a list of things that we want done for some certain end. Certainly not that God wants something from us, for a want implies a lack, and a lack is an imperfection. Besides that, if God had any ends, God would immediately fulfill them, because God is omnipotent. So God doesn't have any kind of plan in the normal sense of the word.
This is because God is very far from the normal sense of anything. God doesn't exist in time, or space, and action occurs in time, so God doesn't act in the normal sense of the word. Thinking is an action, so God probably doesn't even think. Augustine probably wouldn't go this far, but I don't see how it's even possible for God to have a subjective experience. In any event God is so far from our normal existence as to render our intuitions on this front totally meaningless.
Presumably God had some reason for creating us, but we probably can't know what it is. What we do know is, our ability to sin was given to us intentionally by God, and, because God doesn't do anything bad, it was given to us for a very good reason. We are somehow better, or more worthwhile, for our ability to sin. Augustine's discussion of this point is pretty lame, so I'll skip it.
In sum our free will is good and in accord with God's "plan".
Free will and omniscience?
It's not clear how it is possible for us to have free will. As suggested in comments, this is probably a pretty good place to start. I'm not particularly convinced by any of the arguments. As far as I can tell---and I haven't read nearly enough to make this claim with any sort of authority, so please, correct me in the comments---there's no clear answer to the question "How is free will possible at all, let alone in the presence of divine omniscience?"
Kant thinks that we cannot in fact know that the will is free, but that we are forced to act under the idea of freedom.
[R]eason would overstep its bounds (Groundwork S3) if it tried to show the source of freedom. The best we can do is ask, do we have the grounds to believe that we are free? And yeah, probably.
None of this must be very satisfying. We don't know why we are free, and we don't know how, and we don't know why we exist, but we have to believe that somehow everything works together. That's what it means to have faith.