yeah, dumbledore planned to use even his own death to help the good guys win. There were a few hints along the way, like when professor mcgonagal attacks Snape and the death eaters, snape deflects the attack into the bad guys.
of course, I was always expecting snape to do more with his turncoat move than he did.