Static defense in the early game can be a complete game changer. Sometimes it’s as simple as knowing the exact timing of when to plant that first Spine Crawler to defend a Speedling all-in or timing out the first Bunker to stop early Gateway pressure from ruining your TvP early game. These sorts of timings are almost always written up in the IMBAbuilds build orders themselves – so be sure to know them!
However, reactive static defense is a lot less of an exact science. In general, you should never produce more static defense than needed (aka – no more than it says to make in the IMBAbuilds build orders) unless you scout your opponent up to something that requires an immediate reaction. If your army is too small to deal with an incoming attack, an extra Spine Crawler, Cannon, or Bunker is usually a wise investment. However, do NOT overproduce static defense! Building a lot of structures immediately cuts into your army production (which you need to defend everything now), your worker production (which you need to later fund everything), and your later tech (which you want to get ahead later in the game).
Finding the balance between not enough static defense and too much static defense can be tricky and is largely based on your own personal experience/early-game micro, but (at least in the early game) the general rule is that you should prioritizing production over static defense unless you NEED static defense to avoid instantly losing the game.