I think I've cracked Laws original plan but i dont know if it has been discussed.
Law has actually been playing Luffy and crew since the end of Punk Hazard. Law specifically let Smoker know where he was headed. Law wanted Smoker to call reinforcements to Dressrosa. They were actually supposed to help Law.
Law was using the Strawhats to destroy the factory, this was just something to keep the Strawhats busy whilst fulfilling his goals. Law wanted to get rid of him by abandoning him whilst Law did his own thing.
So here we come to chapter 713. Law, Fujitora and Doflamingo all arrive at the beach. Law gets the report that Doffy didnt quit the warlords and from then on it has been pure improvisation on his part.
Law at that moment was supposed to have an Admiral at the beach, he foreshadowed this. Smoker told the meeting place to Akainu, who was going to be there, and how strong their forces needed to be in order to arrest Doflamingo.
Law still wanted the factory destroyed. So from the moment that Fujitora asked Law if the Strawhats had allied or not, he said to himself "i need to stall them off" (or something along those lines). Law was prioritising what he wanted done. His original plan was infact to arrive there and tell Fujitora that he did not make an alliance with the Strawhats and would infact team up possibly with Fujitora and take Doflamingo down with huge help. His original answer was going to be "i have not allied with the Strawhats" therefore keeping his warlord status whereas Doflamingo would have lost it.
If Doflamingo did step down according to plan it would have been the opposite situation and Doflamingo would have been where Law was getting gangbanged.
He may have planned on actually having them captured or killed because he said in 743, "If you let me loose ill kill you".
Laws plan is only Doflamingo, i think that the reason he became a pirate was to take down Doflamingo, become a Shichibukai and infiltrate Doflamingos plants etc. Law has not shown any interest in actually becoming the pirate king but just to take down Doflamingo with the years of anger that had accumulated.
Law had reached up with DD at the end of 724 and said to himself "Stuff it, Im going all out". He did his very best but got destroyed easily.