I managed to keep myself unspoiled (unspoilered?) apart from the rumours that Dumbledore was going to be the character JKR killed off this time around. So of course I have to add a wholehearted HOLY FUCK!!! to the chorus from fandom today. Major, major kudos to JKR for pulling off an apparent 180-degree plot twist of this magnitude!
What do I mean by 'apparent'? Simply that I am 100% convinced that Snape's role as a spy has simply moved from double agent to deep-cover agent. I was very pleased with how well JKR handled this: in reality, a double agent role is a terribly difficult one to sustain over a long term. Issues of trust naturally tend to accumulate over time, compromising the effectiveness of double agents. Any agent hoping to remain alive and effective over the long term must resolve those trust issues by providing 'proof' enough to end their double agent status and adopt a cover as deep as the agent and his true side can dig for him.
The whole thing was planned out between Dumbledore and Snape from the beginning.
Dumbledore knew the Defense position was cursed not to retain anyone more than a year. So he knew from the start that giving Snape that job meant he would lose Snape from Hogwarts after that year was up. Why had it been important beforehand to keep Snape at Hogwarts? For only one reason: so he could preserve his double agent status. But, like all double agents, Snape started to accumulate trust issues among the Death Eaters, as summarised by Bellatrix in the Spinner's End chapter. Once that happened, he had two options: (1) make a gesture grand enough to resolve those trust issues (and thereby abandon his double-agent status in favour of deep cover), or (2) blow his cover, abandon spying, and fail in his efforts to bring down Voldemort. Clearly the second option was unthinkable.
From well before we first see him in HBP, Dumbledore had already fallen victim to a curse which was not only incurable, it had almost killed him immediately. Just how far the curse damage spread up from his hand is never made clear, nor whether the damage was progressing. Even if Dumbledore was not dying slowly from the ring's curse, the question is moot: the distrust among the death eaters had forced him to take the decision (by giving Snape the Defence position) to send Snape into deep cover that year. And they could surely anticipate that it would take a gesture of faith as grandiose as Dumbledore's death to provide a cover deep enough to maintain Snape's effectiveness.
Either the ring's curse, or the impending compromise of Snape's double-agent status would have been enough of a reason on their own for Dumbledore's sacrifice, but JKR provides us with a third reason. Whatever the nature of the potion he drank, it was slowly lethal. (I think that potion was itself a horcrux: judging by Dumbledore's cries, he seemed to be wracked with guilt as well as physical pain). Even if the potion was a mere slow poison, Dumbledore was clearly already dying when he arrived at the Tower. Yet he refuses Pomfrey's help; will have Harry do nothing but get Snape.
This fact that Dumbledore is already dying casts his words to Snape in a completely new light. He is pleading with Snape - to do what? He never says 'No' or 'Don't', or otherwise begs to be spared. No, these two skilled Legilimens stare into each others' eyes - and in that contact, I believe Dumbledore asked Snape to carry out their pre-arranged plan: use Dumbledore's already-inevitable death to cement his deep cover among the Death Eaters. Snape's expression of loathing is, in this context, hatred of the role he must play. Disgust that he must add murder to his crimes. He expressed his reluctance to follow Dumbledore's plans before: during the argument Hagrid overheard in the forest.
Of course, they had not planned for Draco to be there (Snape, it is clear afterwards, had not been aware of Draco's plans) but it just adds a fourth reason for Snape to kill Dumbledore: the added benefit of saving Draco (whatever his crimes, still more of an innocent than Snape) from becoming a murderer - and sustaining the associated injury to his soul.
So, we know that there are four possible reasons for Snape to cast Avada Kedavra on Dumbledore, while still remaining an agent against Voldemort.
Turn from that to Snape's conduct to Harry. I found it striking that, even during the running battle at the end, not only does Snape separate Harry from the Death Eaters, actively warning off one of them from Cruciating Harry, not only does he deflect Harry's fire rather than returning it, even his words, which had to be interpretable as goading by the within-earshot Death Eaters (and which were interpreted thus by Harry) were lessons, to the end, in the two things Harry still needed the most to learn: a closed mouth (nonverbal spellcasting), and a closed mind (occlumency). A teacher to the end.
Only when Harry called him a coward does Snape finally return fire: and right after having been forced, over his own objections, to ostensibly turn his back on the side he was fighting for, by personally killing his commander-in-chief, the man whose testimony kept him out of Azkaban. I'd say, under those circumstances, he wouldn't be human if that hadn't shaken his control.
Now, I'm waiting for Book 7, where, I am utterly convinced, JKR, Queen of the Backstory, will astound fandom once again by taking this wonderful 180-degree plot twist and turning it into a 360-degree headspinner.
(If only I could shake the conviction that Book 6 has left me with: that neither Harry nor Snape are going to survive the end of the series...)
P.S.: Is there anyone else here who was TICKLED PINK at the thought of Harry learning from Snape's potions book? I love the proof that Snape was constantly improving on N.E.W.T. level potions as well as inventing his own brand-new curses, while still at school. It more than made up for the revelation that Snape isn't a grand old wizarding name, and that Snape's nasty dad was actually a Muggle. Mind you, it does raise the question of why Eileen Prince put up with his abuse. I wonder if Book 7 will ever get around to clearing up that little mystery, among the dozens and dozens of other, higher-profile plot threads that'll need tying up.
P.P.S: This book is further proof, as if it were ever needed, that JKR is well and truly in touch with the fandom. In this book we see, for the first time, the DADA acronym, a fandom coining if ever there was one: In all five of the previous books it makes not a single appearance.