Disclaimer: I'm not muscling in on JK's turf - just gambolling on it, like a spring lamb, having fun working out the literary and psychological puzzles which she is having fun setting us
The Story So Far: [Being a summary of the plot of Mood Music, the story to which this is the sequel.]
Dumbledore ordered Snape to kill him on the Astronomy Tower but Snape in fact refused to do so, instead faking Dumbledore's death by saying Avada Kedavra without meaning it (which we know does no harm at all), whilst silently flipping him over the wall with Levicorpus to get him away from the Death Eaters. He does not know whether Dumbledore actually survived or not since he had a long fall and was already both cursed and poisoned, but if Dumbledore is alive then he has been spirited away into hiding by Horace Slughorn. Initially everyone else believed that Snape did murder Dumbledore and it is imperative that Bellatrix at least should continue to believe it, because if she realizes that Snape broke the Unbreakable Vow to which she was witness and Bonder, Snape will die.
Shortly before Dumbledore's apparent death, Percy Weasley spotted that a Ministry official had been Imperiused and this caused Voldemort's plans to take over the Ministry, and Hogwarts, to fail. The Ministry's decision to close Hogwarts, which is no longer considered a place of safety, and use it as an administrative base further diverted the timeline from the one in Deathly Hallows, so that Snape never became Headmaster and Voldemort's forces remained in hiding.
Snape was left stranded among the Death Eaters for months, without a friend he could call his own or any chance to use the Pensieve to prepare himself mentally before entering Voldemort's presence, as he usually did. Some time in the first two weeks of the December following the end of HBP, Voldemort became suspicious enough to set Snape a test of loyalty, which he failed (by refusing to take part in the sexual abuse of a child). Snape was imprisoned at an underground Death Eater base in the vast, ancient mine-working called Chislehurst Caves, and subjected to extreme torture.
Meanwhile, Voldemort and his minions had been investigating what powers might be possessed by Muggle psychics and occultists, with the intention of either recruiting or destroying them. Two days after Christmas a battered and traumatized Snape and a bemused Muggle shaman named Lynsey O'Connor escape together, and spend two and a half days blundering about in the darkness of the mines. Initially they are being pursued by the Death Eaters, but by the time they finally find a way out the boot is rather on the other foot - thanks to Snape's inventive way with hexes and a creative bit of psychological warfare involving nihilistic music. In the process Snape and Lynsey become good if slightly edgy friends, royally piss off Lucius and are tentatively assisted by Draco. They are also forced by circumstances surgically to remove Snape's Dark Mark.
As an act of terrorism, rubbing the Order's noses in their own helplessness, Voldemort had caused members of the Order of the Phoenix to hear Snape screaming and pleading under torture - Voldemort being a psychopath with no understanding of friendship or compassion, and therefore being unable to predict that this would make the Order more inclined to sympathise with Snape and listen to his point of view, rather than shooting first and asking questions later as they might otherwise have done. By the time Snape, with Lynsey still in tow, staggers into an Order base-camp on New Year's Eve suffering not only from the after-effects of torture but from pneumonia, Poppy Pomfrey, Minerva McGonagall and Remus Lupin at least are inclined to listen to his version of the story and give him the benefit of the doubt.
Harry is reluctantly and grudgingly persuaded that Snape is probably still a loyal member of the Order, even if he still doesn't like him much, and they talk out enough of their differences to be able to work together. Lupin, more wolf than man, cheerfully announces that in Dumbledore's absence Snape is now his alpha male - about which Snape is somewhat less than ecstatic. But Mad-Eye Moody is still convinced that Snape is a traitor and a murderer, and that the fact that he was tortured by Voldemort only proves that he is entirely self-serving and betrayed both masters.