Jordan is an example of a fairly stable Islamic country. What have they done right?
1. Their royal family doesn't have any delusional utopian ideas about what "democracy" is all about.
2. They have kept their British ties strong.
3. They don't take sides in regional disputes, even if they have to pay a price in the short term (see their refusal to join the U.S.-led coalition in Desert Storm back in 1990 as a case in point).
4. They are a "beggar nation" to a large degree, which means a lot of countries have a financial stake in seeing them succeed. Their economy would collapse without billions of dollars in foreign aid.