Namaste. You seek balance. Here is my wisdom. Your mistakes have no cost but time, and the deconstruction planner even reduces that cost. Most games punish you for building, demolishing and rebuilding. Not Factorio. Let your anxiety wash away as you perceive that every belt placed can be moved. Every assembler is but a visitor to where it resides. The only significance is life, which leads to the further wisdom. Look both ways before you cross the tracks.

So everyone knows that the biters can be a pain to deal with. Well, I believe I have come up with a solution for your defensive needs. Introducing the biter beacon: a large light that attracts biters within a radius around it. This is an idea that I have come up with. It should be straightforward, but basically, what I am thinking of is a structure that has priority over everything else in the biters' targeting. All you have to do is place them down throughout your factory and surround them with turrets to get rid of biters with ease. It would be unlocked with the lights research and be made with the same parts, however, it world require more of those parts because it is a bigger light. It would have the same health as a regular light but would require more energy because it is a bigger light.

TL;DR The biter beacon attracts biters in a radius around it. Surround it with turrets and you have a biter killing machine.

Why not piggyback off of the idea from Half-Life 2 and create restrictor like structures that deter the smaller biters completely but have no effect on the larger ones or worms.

In short what this machine would do is pound the ground, each thump will send biters fleeing out of it's AoE. It does no damage, but allows you to have openings into your base without worrying about small biters getting in and you not noticing.

Edit: I should point out also that the biters are still fighting capable as this doesn't stun them, it just forces them away from the Restrictor, thus away from easy entrances, train depots, or boiler chains.

If you're having trouble defending, build walls all around your base, with zero gaps, and an even amount of layering (always 1 tile thick, or always 2 tiles thick. Then, when the biters attack, make note of what area of the wall they attack, mine out a 3-4 tile gap. use walls to build a 6-12 long corridor in and out, and add the turrets along the outside of the killbox, and then surround the turrets with more walls, so that they're protected.

After that, the biters will go through the killbox, and get pulped. Add inserters and a belt, and you can fully automate it with a single autocrafter.

You could balance it be having it call biters to your base from further away. This should balance the fact that biters are easier to kill with having to deal with more of them. Also good for multiplayer, you could use them to mess with other players bases.