If left on they own the Dwarves *allways* run the wrong way

I had multiple occasions where my Dwarf was interrupted right on the entrandce to the fort - just a few steps over the drawbridge (and the traps) from safety. And he allways runs outside...
Military Dwarves have addtional options on Squad level (Even if it's a single Dwarf, he's still a Squad).
What you want is to set his Squad to Not Chase Enemies, then station the Squad a good deal away from the enemy, moving in a straight line away from the enemy group. Once (if) you got some distance beween you and the enemy you can redirect.
It's unfortunately not 100% foolproof - i.e. if the Dwarf is already very close to the enemy (like 1 square away), he will often engage, despite the above orders. But most of the time it does work.
In this case you could also draft and trow in some of the "other" Dwarves, who you wasn't concerned about