Coherent control of spin squeezing