i actually like a suggestion Ian Spence made, where we split it into 2 textareas.

1 for php code
1 for markup etc

then the behind the scenes stuff takes care of putting it in the right place.

2c