Obama did not give the order to engage the pirates; it came from a local commander on the scene. If the situation had not arisen that caused the local commander to give the order, the situation would likely still be in a standoff at this time.
No doubt the Obama administration is going to try and take all the credit for this they can. They should have given this order as soon as the Bainbridge was on scene instead of playing games with pirates for 4 days.