Obito will not turn good like Sasuke or Nagato. As Shikaku confirmed at the start of the war, Obito is real darkness, true despair, he isn't like the others that Naruto and stuff clashed. The only possibility for him to "betray" Madara is to learn that Kakashi was manipulated by the first one with a genjutsu, forcing him to kill Rin, but he still won't be "good" . He's been the main antagonist for the whole Part II, he attacked Konohagakure with Kurama long ago, so I don't think there's a chance for him to be on the good side, if this happens though, it'll be the best bull$hit that ever happened. :O