The problem with Snape is that I suspect that at the beginning JKR intended him to be fully bad. Either that or she wasn't able to portray him as she wanted him to be in her writing.
He immediately starts bullying Neville. He knows Neville's history and he has no reason for it. Now if he'd bullied Harry only, and been merely civil to the rest of the non-Slytherins, then you could argue that he's either hiding his affection for Harry, or that he's trying to toughen him up for what he knows will come later-the fight with Voldemore.
But he is almost cartoon nastiness in how he behaves-gives Miss Trunchbowl, who is cartoon nastiness more than a run for her money.
that's just in the first book.
Look at how he talks to Dumbledore about Harry: "He is mediocre to the last degree, though as obnoxious and self-satisfied as was his father before him."
That's not the talk of a teacher about a pupil. He's not talking to Malfoy about him, he'd trying to influence Dumbledore about him. At that point Voldemort is weakened to a point he's not going to be able to listen in-there is absolutely no need for it.
He was willing to let Voldemort kill Harry and James as long as he spared Lily. Even when he went to Dumbledore asking him to help, he was still only interested in saving Lily.
Then when he was meant to be teaching Harry occlumency. He makes no effort although he knows it will not just effect Harry, but potentially the whole Order of the Phoenix.
To make his redemption realistic JKR needed to show the dilemma which increases as Voldemort comes back to power. Does he help Harry, or does he pretend to bully him? She could have shown him behaving as Harry thinks as a bully, but in a way that he/the reader could look back and say "no he wasn't being nasty, he just had to make sure Harry mastered it because he needed to. He couldn't be nice and let Harry fail". But you reread the early books and don't see that. he's often nasty for the sake of being nasty.
He could have equally well been nice and told Voldemort he was doing it so he could be there to deliver Harry to him at the right time.
And anyway, surely the false Moody, who seemed to be fairly well in with Dumbledore, would have picked up that Dumbledore thought he was a double agent?
Harry giving Snape's name to his ds was lazy writing to me. It was trying to give Harry feelings towards Snape that weren't there throughout the books. He may have felt some gratitude, but I'm not sure even that was really necessary. Snape didn't die for Harry, he died because Voldemort needed Snape dead. Snape did not show Harry any affection-he really only wanted Harry to look at him at the end so he could pretend Lily was looking at him.
Snape only became a double agent because he had to. It wasn't for want of the right side winning he wanted to help. It was he promised Dumbledore "anything" if he'd save Lily. If Voldemort had promised the same he'd have promised him "anything".