Sort:  

I found time after all and even did it in GolfScript for maximum saving XD.
Here's my entry. I ended up doing a bit of a wall of text explaining my reasoning, but you can find the answer at the beginning if you don't want to read my ramblings XD

Nice solution =D