To deal with suicidal tendencies, I construct my forts to minimize the disadvantage of cut-off dwarves. However, I feel no remorse about letting stray dwarves die, especially if they were too inexperienced to defend themselves.
In Fortress Defense, I assign my military to a burrow defined just inside the entrance and use an alert that tells them to go there when enemies come. I construct my fortress entrance behind a narrow path defined by walls, so that all enemies require a long time to get to the entrance to my fortress. If I use traps, they are positioned at the entrance to the path and built toward the fort (I generally never use more than 2 or 3 serrated discs to kill random elephants, along with cage traps that are not loaded unless I want prisoners for my arena).
Now, when the enemies come, I might temporarily seal the entrance behind them and wait until either I'm satisfied with the outcome. This also prevents enemies from escaping or killing my haulers while loot is gathered.
Alternately, I let my military decimate the first squad and then, if any (valuable) soldiers start pursuing, I order part of my military to escort them. The narrow path prevents new enemy squads from ganging up on my isolated men easily while giving my soldiers time to catch up to each other. In addition, the order of traps-> path -> fortress means that my soldiers are only fighting far behind my trap lines, meaning that even if they pursue, the enemy will generally encounter my traps before my army.