Given that there is pretty much never *any* circumstance where text within script or php blocks should be touched by formatting functions, it seems to me that one of two things should happen (hopefully as a standard part of WordPress) —
1. wpautop and wptexturize should be improved such that they ignore at least script tags and possibly php tags, and even better a configurable array of tags. Basically, nothing within these tags should get touched and they shouldn’t be wrapped in p tags either.
2. There should be some sort of “no-op” markup you can add to posts which prevents wpautop and wptexturize from touching what’s inside. So, for instance, you could manually wrap a script tag in specially designated HTML comments which would tell formatting functions to lay off.