I think that political motivations are like icebergs. Most of it is hidden from view.
Either Obama felt that his actions could withstand a court challenge, or if he knew that it couldn't then he has some other agenda. This could be a win-win for Obama. Either he gets his way, or he gets to blame the Republicans. A less likely target might be the courts.
Anyhow, Obama didn't go into this without some sort of game plan if his actions were overturned by the courts.