There were a couple of things wrong here:
1 - The whole recursive frame load waiting thing was totally unnecessary. Load
doesn't fire on the window until all descendant iframes have loaded.
2 - The chrome event handler wasn't filtering by target, which it should. This
is probably to blame for the intermittent orange.
3 - Setting window.location during document load actually invokes
window.location.replace.
4 - Session history navigation seems to have weird behavior when called from
an onload handler. I wanted to investigate this further, but I've already spent
too much time on this. SimpleTest.executeSoon() seems to do the trick here.