Forum Moderators: open
Orig. posted in Google forum, but it got lost in a heated debate on another subject.
FWIW, I've seen pages in the cache with similar javascript to what you propose. I haven't tracked their success over time, so I can't say for sure how Google has viewed this.
To me the situation seems straightforward. Google SHOULD prefer a fix over serving up a dysfunctional page. But, these are my thoughts, not Google's. And you don't want to lose that traffic, even short term.
Perhaps the safer route would be to use the googlebot meta tag and keep your pages out of the cache altogether. That way there's no chance of tripping any automatic alarms with a re-direct. After all, the end result of your proposed code is to take the page out of their cache anyway.
And if the meta tag earns you a hand reveiew, you're innocent of wrong doing so there should be no problem.