When Harry learned of Dean's deal the firth thing he did was ask for the specifics.
Sam was a mess, knowing he was the reason his brother was going to hell and Dean was resigned. He couldn't try to weasel his way out of the deal or Sam would die again.
But Harry, Harry was familiar with binding contracts. Contracts, be magical or muggle, or demon as the case may be, were tricky things. The demon thought she was smart, putting the part were Dean couldn't look for a way out. The thing was, she say nothing about others looking for a way out for Dean.
He was going to have to check this out thoroughly, maybe pay the goblins a visit (he was sure they would not mind consulting for him, for a fee, of course) but he would find each and every loophole Dean's deal had and would get Dean out of it without breaking his side of the contract.
He was a wizard, he knew how binding the magic in contracts was, how leaving thing to interpretation could mess everything out (check his four year and forced participation on the Three Wizard as an example of a too open contract, after all nowhere in it say that only him could put his name for consideration and the contract did say that if your name came out you had to participate.)
So after getting all the facts Harry got Deans memory from him to check it in a pensive, just to be throughout, and then proceeded to read every book in contracts he could get his hands on (and with the Black Family library spanning several centuries, that was quite the number). Of course he made sure neither Dean nor Sam nor Bobby knew of this. Dean's deal did say he could do nothing to get out of the deal after all and Harry didn't want to risk that knowing someone else was doing something and not stopping them counted. So he acted distraught but accepting of Dean's fate where they could see him and keep looking for an answer were they could not.
It took some time, and that consulting with the goblins, but three months later he had an answer. It wasn't pretty and it was really high risk, but if it work, he was all for it.
So, after ironing the details, he put his plan in practice.
*HP-SPN*
The hunt had sounded simple but it was proving to be anything but.
Sam was bleeding from several cuts and Dean was even worse with several broken bones to add to his cuts.
In one last desperate move they manage to off the fucker and were left there broken and bleeding.
Sam went to Dean's side as fast as he could, Deans breathing was becoming more raged by the minute and he knew they needed to get help ASAP, but he could verily move and the Impala was several blocks away.
Sam was crying and asking Dean not to leave him, it was too soon, they were supposed to have month yet… and then Dean stopped breathing.
Not a second later Harry was there; he started firing spells at Dean and brought potions out of his bag, using other spells to send them to Dean's stomach and blood stream. And then, after what seem like an eternity, Dean started breathing again.
*HP-SPN*
Bobby was not please with any of them, Sam and Dean had almost die after all, and if Harry was there why didn't he freaking help them before it got so out of control. Sam was right with him in the shouting, the memory of Dean dying in his arms too fresh. Dean was not sure how to feel and so stayed quiet.
"Dean's contract was very specific. Dean offered his soul and in exchange the demon promised Sam's life and one year of life for Dean with a clause saying that Dean could do nothing to break the deal or Sam died again. However, despite this clause, nowhere in the deal was said anything about someone else breaking the deal without Dean's knowledge… and I just did. The demon promise Dean one year of life and last night Dean died, a whole nine month too early. Which means the demon broke her side of the deal and Dean is now free."
That shut up Bobby and Sam pretty quickly and left Dean even more stoned than before.
Harry count it as job well done and went to take a bath, Dean had gotten blood all over him.
Fin.