I've found it fairly easy to get forts running stably, if that's your goal here's my advice:
1) Don't breach the caverns, doing so introduces unstable Fun that can easily disrupt your fortress, if you feel you must do this, wait until you've been stable long enough to build up a good army.
2) Become self sufficient as quickly as possible, the goal of a stable fortress is getting to the point when you do not strictly speaking need the caravans for survival, that is to say that if there's a goblin siege outside your fortress and a caravan arrives, you can afford to not open your gates. For that matter,
3) Construct a secure entryway. Your goal with this is to make it so that nothing short of a flying building destroyer can get into your base without permission, and even that can be guarded against if you've become self-sufficient to the point that you don't mind leaving caravans and migrants out in the cold.
4) Keep your dwarves happy, legendarily engraved dining halls and personal bedrooms can go a long way towards this, a happy dwarf is a dwarf who will not go insane on you if one little thing goes wrong.
I will note, however, that a fort geared for long-term survival this way is rather boring to play once you've got it built up, since the smartest move is to just lock all the !!FUN!! outside. Dwarf Fortress is a curious game like that, attempts to fight off what comes at you are doomed to failure, the only winning move is to refuse to play.