Well, you could create two identical applications. One for version 4, one for version 5. Then, just do a quick phpversion() check. If it's php4, include all files from directoryA, otherwise directoryB.
I'm currently caught in a hard-place because i'm trying to figure out a way to make a PHP6 feature available now to my script. In php6 they're saying that var and public are synonymous in classes (FINALLY!). Well, since php6 isn't out yet, PHP5 throws a strict-standards error if you use the deprecated var identifier. PHP4 doesn't recognize the public/private/protected identifiers. See the dilemma?
For me personally i think that 2 versions of the same scripts will be available. I can say that because I know that the difference(s) between PHP5 and PHP4 in my case is just a few minor issues. Depending upon the size of your script, it may not be feasible.
PHP 5 is production ready. mySQL I don't think is as ready as it could be. I know it's stable and rock-solid; however, it's under a new license. I think PostgreSQL would be a better solution now, or at least a better alternative. Even SQLite wiould work.
But look at your code and see if you need PHP5. If you don't (i.e. your code won't use any PHP5 functions) stay with PHP4 and wait for PHP6. If you need functions that are only in PHP5, then upgrade. I honestly haven't seen a huge difference except in which functions and DOMs are available and more-accessible.
So it's a planning thing as Jason said. Do you need the XML DOM and other PHP5 features, or can you live with PHP4 and its security until PHP6?
Same goes for mySQL. Do you use any mySQL 5 functions or not? If no, stick with 4 as it seems to be more widely adopted. If you just MUST use mySQL 5, check out the PostgreSQL database solution as an alternative. Heck, it might even be faster... but I'll let Sxooter fight that battle...
~Brett