It takes a little bit of foresight, but it's not that big of a deal.
First off, Fast Travel is your enemy, unless you know the travel times very well. If you want to stop vampires from attacking settlements, you need to be aware of the time.
Vampires can attack anytime between 8PM and 5AM, they will only spawn if you're in the same cell, and will always spawn at or near town entrances. Once an attack happens and is repelled, there's a considerable delay before another will happen. I've actually gone two months or more without having a vampire incident in some cases, but the average is around two game weeks.
First and foremost: Save often and in multiple slots.
Next, try to enter towns either very late at night (When everyone is asleep, this is usually after 12AM-1AM) or during the day. If you want to attempt to Trigger a vampire attack to reset the cooldown, it's best to go for those late-night walks around town.
As you get higher in level, Vampires become less of an issue, as the guards are scaling up as well. The most dangerous attacks will happen between level 8 and level 12, where a single Master Vampire can annihilate an entire town of guards and civilians, thanks to their drain life spell. Triggering this attack should be done in precisely controlled conditions. I usually wait in the Drunken Huntsman once I reach level 8, until 1AM, then zone out sneaking until the Master Vampire spawns and attacks the guard(s) at the gate. Dispatch any Thralls first, and if you have some kind of stamina regenerating food, use it and "Bash-lock" the vampire while the town kills him.
Any settlement that doesn't have it's own zone is more vulnerable to vampire attacks. Even with a standing force of guards, the event may load at a pretty generous distance away, giving a vampire time to kill some of the weaker civilians, the best way to be sure that you're not having a depopulation issue is to go through any nearby towns to check. If a Vampire is present, do a headcount and back up your most recent good autosave before it's overwritten.
The most vulnerable settlements are:
Riverwood, especially if you don't want to loose Stump.
Rorikstead
Kynesgrove
Whiterun, especially because Adrianne Avanicci is usually the first to die.
Riften outside the North gate. One guard and several civilians. This place also tends to spawn vampires higher than Master, including Nightlords.
It seems like it's a huge pain, but honestly, I don't find it that intrusive to my playstyle.