As noted in the comments, no attacker poses a threat to your settlers lives in vanilla Fallout 4. They can of course still inflict other damage, destroying crops and damaging items.
In general, the best way to prevent damage to your settlement is to get there as soon as possible and engage the enemy before they reach the border of your settlement. This is possible with just about all enemies, but easiest with ferals. The event seems to be timed, and ferals moves the slowest until they have a target to charge.
I have done this several times with all levels of ghouls, though the charred ghouls I did this to were not attacking Greentop Nursery, not Kingsport.
In addition, when fighting ghouls, go for crippling leg shots whenever possible. Cripple a leg and the ghouls loses nearly all of its threat potential. Even the charred ones just lay there.
To address your specific questions...
1) As above, when possible. Carry the fight to them.
1a) Walls. Wall off your settlement. This forces attackers to choke points you can select, where you can make sure you concentrate firepower. Do be careful here, because your settlers will also run out through those choke points to engage enemies, and friendly fire can kill them, whether yours, a turret, or each other.
2) 1 Heavy Machine Gun (preferred) or 2 Machine Guns (if you can't build a Heavy) PER SETTLER. 1 Heavy is preferred because they have superior range and accuracy as well as damage. If you only look at the defense points, 2 regular seems better, but that's just not the case.
2a) If you have walled the settlement with a choke point, set about 50% of the turrets with line of sight on the choke point. Set the remaining around the walls. This lets you determine direction when only one or two turrets fire, giving you time to move into the area and inflict some damage yourself.
2b) Give your settlers decent weapons, but NO EXPLOSIVES. They will blow themselves up. The AI is terrible and I've watched a settler fire a fat man and point blank range on a raider. Funny... but wasteful.
3) Heavy Machine Gun Turrets are my favorite. As noted above, they have superior range and accuracy. In addition, they also have the second lowest chance (lowest is a regular machine gun turret) of accidentally killing a settler. A settler can be killed pretty quick by a laser turret or missile, but it would take some sustained fire to kill one with a machine gun or heavy machine gun. (However, be careful. If you do 2a above, a settler will wither pretty fast if he gets in the way of ten heavy machine guns at a chokepoint).
3a) Missiles are great IF you can set them up so they only have line of sight facing away from the settlement and any choke point you've set up. They have a very long range, so I like to elevate them, and partially enclose them so they can't turn around and fire into the settlement. One way is to build your walls a short distance inside the border, then place the missile turrets outside the wall. To get the needed height, I usually have double-stacked walls in those places.
4) This is not a guarantee, especially in survival mode, but I've found settlements can often defend themselves without intervention when their defense total is more than ten times the number of settlers. This is FAR higher than the number needed to turn the settlement green. I did this in a game by deliberately setting up different settlements with different amounts of defense and then ignoring their calls for help. Those settlements with ten times the number seemed to defend themselves reliably. Those with under five times seems to fail to defend themselves most of the time without my help.
Best Answer
Piper uses a standard 10mm pistol. I crafted a much stronger one to give to her hoping she would use it instead of her normal 10mm. unfortunately when i equiped it to her she pulled it out, then when we got into combat went back to her default 10mm :(