Just keep an eye on the militarly power graph and never let anyone get a significant lead over you. Much easier in 1.03.54 because battlehammers are now just 3 maintenance (they used to be 6), you get a lot of boost for your buck with those. Note, however, that if you turtle you run the risk of one of the other AIs going hogwild all over the map. Then you are in trouble, it's very hard to match the military output of 80% of the galaxy when you only have 20% of it to work with.
Turtling works best when none of the AI civs get eliminated, sort of a SimGalCiv sort of situation where there is give as well as take between everyone. But I've been burnt twice now because I thought I could get away with just holding the systems I had only to have one AI civ conquer the rest of the galaxy and then come for me before I could get the research victory. Lot of hours get wasted that way, so now I no longer take that chance: the best defense is to pin their freakin' ears back till they howl. Especially the Altarians and Torians, darn goody-twoshoes milksops.