Well, I think writing is basically about time and rhythm. Like with jazz. You have your basic melody and then you just riff off of it. And the riffs are about timing.
You have to have as many defences in place as you possibly can. But even then of course - and it's important to stress this - you cannot guarantee being able to prevent every attack or every kind of attack.

