I don't think it was planned to let Danzo be hokage, and thus let him help Obito in any way.
Obito said to Danzo (and sasuke) that last time they met, was during the uchiha massacre.
Unleashing the kuybi wouldn't really let Danzo take over, unless you assume that Obito would defeat Minato, and 3rd hokage, would use DRS on the fox, but that is quite a a bet to make. Even Danzo knew, Minato wouldn't be defeated easily.
It's more likely that he did it to give Danzo a reason to spread doubt on the uchiha, thus making them want to make a coup.
Going further, Yagura from Kiri, was not being controlled by any std genjutsu. It's likely to assume that Danzo used KA on him, with a command, to follow "Tobis" orders. I don't believe Danzo ever knew about who "Tobi"was, and what his true plans were. It doesn't make sense if he did. Danzo loves Konoha, and would do anything for the village. His name even means "I did it for the village".
But letting some random organization (akatsuki) control kirigakure, would be fine for Danzo.
Going further, Danzo was also partly cause in what turned Nagato to hatred. His 2nd great pain, when Yahiko died, again it's possible that "Tobi" had something to do with it. However, it's doubtful. Danzo had every reason to ally with Hanzo to remove some angry upcoming gang.
I call him Tobi, cause Danzo obviously had no idea, it was Madara. So he must have told him another name, or used some middle man (possibly Orochimaru? Obito also said that Kabuto and Oro knew a lot about Danzo and him, so it's likely that some point in time, Oro betrayed him, probably when he left akatsuki, so all the time Oro was just "helping" Obito to get some important info to himself)
Thought about this long ago tho, but don't see it having anything to do with Danzo becoming hokage. Danzo clearly had no idea about pain attacking. He wanted to be hokage at this point in time, but he didn't want them to get the kuybi, which was obitos 1. intention. He would rather get the kuybi at this point in time than making Danzo hokage. This is also why Danzo killed the frog, to avoid Naruto to be captured, partly at least.