actually, if I remember correctly, there's actually a command to reference the default project directory, or the current one. Something like that.
My question is - why do you want this script, anyways? It can really only be used once per scene, and is so simple to set up manually that there's no real need for it. If you were doing this, say, 100 times, then there might be call for such a script, but as it is.... (and even if you did want 100 planes with images on them, you wouldn't use them all as part of the built-in image plane anyways.... well, at least I wouldn't).