The detection of gravitational waves (GWs) from space is a hot topic in astronomy and space science, as the Space Gravitational Wave Observatory can detect low-frequency GWs from various sources. The long-term stability of the configuration of GW observatories is the key to the success of GWs detection, which challenges the configuration design and optimization. This paper innovatively proposes an semi-analytical double-layer iterative optimization algorithm (DLI) to solve the geocentric configuration optimization problem. First, an iterative method with gradient information of breathing angle, which is compensated by its standard deviation, is introduced as the inner iteration layer. Then, the outer iterative layer executes the initial value update process via the selection of the constructed candidates with smallest arm length variation rate, until the maximum breathing angle variation converges to the preset accuracy. The proposed method is applied to optimize the nominal configuration of TianQin mission. The results shows that DLI can reduce about 99% computation duration compared with the numerical optimization method. Furthermore, the influence of initial configuration elements on stability parameters are analyzed, providing better alternation for geocentric GWs detection missions.