Gated communities cost more up front. Here is how to decide whether the premium pays off for you.