I’m pretty sure I posted this by mistake.
If you’re interested here’s the “final” /improved version, I guess.
Unfortunately, it did overstay its welcome by a fairly wide margin. But, it also got much better before it all fell apart.
http://www.netcees.org/showthread.php?t=164715