I believe playing nice with Margaery was less about keeping Tommen safe, and more about her scheming to have Tyrion executed. Margaery's dad, Mace, is to be one of the judges at Tyrion's trial. Mace is considered kind of a dumb oaf, so she goes through Margaery attempting to score some points with the Tyrell house in…