He KNOWS what he is doing, but his goals are not your goals or mine. Socialism does not require prosperity. Totalitarianism at home does not require victory in war or even prevention of 9-11 type attacks.
He's knows what he's doing in the area of domestic policy--he thinks the entire economy is HIS to redistribute as he sees fit, to his supporters and favored special interest groups. He's an idiot internationally, but is very good at deceptive and destructive manipulation of the legal system. He is, after all, a community organizer and little else.