Was tobi meant to be obito or was it a last minute changehmm
My analysis suggests that it was a planned thing. Kishimoto doesn't seem to be one to answer "who could be behind this?" with "It's me - some random character you've barely heard mentioned! I was behind it all along!"
Tobi's mask centers around the Sharingan he has - artificially restricting him to one eye - and who else only has one Sharingan? There was, also, a lot of effort put into developing Obito in Kakashi's history and experience with frequent foreshadowing along the lines of: "What would you think if you were here, Obito?"
Also, the fact that the only other person we've seen with anything resembling Kamui is Kakashi.
It really didn't come as a surprise that "Tobi" and "Madara" were two separate people. Why go through the trouble of wearing a mask or make the comments of "I'm but a shell of what I once was."
That leaves the list to a pretty small number of known characters (with the most likely being Obito) - or the introduction of a completely new character with fifty chapters of flash-backs to tell us who he is/was and how he came into the picture.
So, instead of breaking the continuity - Kishimoto decided to only use 10 chapters of flashbacks to describe how Obito survived (which he couldn't do beforehand without ruining the 'surprise!')