I'm not sure it would work like that, given that Cersei didn't become queen when Robert died and in our world, Elizabeth the Queen Mother didn't become Queen when George VI died.
If anything I imagine that it would technically make Margery the Queen Dowager, as our own Queen Mother was after George VIs death, but not Queen.
You're right, not possible. Reading up, there hasn't been a Queen of Westeros - the laws of succession put all male heirs - even cousins and second cousins - above female heirs. In the event of the King's death, the throne would fall to the next male heir. That does say interesting things about Dany and her claim to the Iron Throne, as it would technically mean that Stannis is the rightful heir (they are second cousins).
Still, the Lannisters will need to appease the Tyrells. Even if they don't have a claim to the throne themselves, they could still walk away from King's Landing, leaving it starving and vulnerable to attack.
Even if Marjorie had consumated the marriage she has no claim (assuming it works similar to the real world), Cersei had no claim when Robert died.
So it falls to Tommen, but Cersei wasn't powerless with Joffrey on the throne so she'll still have a lot of influence.
It's not really the same situation, so it was possible. Robert had children, Joffrey did not. I wasn't initially sure who rules upon the King's death - the king's brother or the king's wife. It would be entirely dependent on the rules of succession (which, in this case, are very clear).
Are people even asking this? Of Course Tommen is next in line seeing as how he's Robert's Second son (even though he isn't). What claim does Margery have? The wedding wasn't consumated.
If you're powerful enough to claim the throne then you only need a tenuous link to stake a claim, especially when other powerful claimants have equally tenuous claims. Had the laws of succession put wives above brothers then the marriage not being consummated would have been brushed aside as a minor detail. As we've seen, being the rightful heir to the throne matters less than being powerful enough to claim it.
It's a moot point though given how far down the succession order women fall.