अष्टचक्रा नवद्वारा देवानां पूरयोध्या |
तस्यां हिरण्ययं: कोश:
स्वर्गो ज्योतिषाsवृत: || A.V 10.2.31 ||
Eight-wheeled ,nine doored , is the impregnable stronghold of the
gods;in that is a golden vessel,heven going (swargaha),covered with
light. - (Author William Dwight Whitney)
The Atharva-Veda Sukta 10.2 is known as Brahma Prakashan Sukta it is also called as Kena sukta because it is similar to Kena-Upanishad and it starts with the fundamental question " By whom ? "
In this sukta various philosophical questions regarding the human body its specialities, characterstics, Gunas, nature of the universe and its sustenance are curiously raised
The mantras you quoted in the question are about "Wonderful structure of man" i.e they are talking about how the human structure or body. And that body is so much powerful that it is well capable to resist any and all external negative influences, forces which are obstacles in our understanding our self as well as the nature of the universe i.e achieving moksha and become one with brahman.
Some articles argue that Atharvaveda described Ayodhya as the city of Dasharatha mentioned in Ramayana and other scriptures. But this is not the case the word Ayodhya is used in different context throughout Atharva-Veda.
According to scholars, such as B. B. Lal, the word Ayodhya in this context is not a proper noun (the name of a city), but an adjective, meaning "impregnable"] The verse describes the human body (pur) as having eight chakras and nine orifices - (page 47) of his PDF.
It would be seen that Whitney has taken the word Ayodhya not in the
sense of proper noun, i.e. not as the name of the city, but as a
compound word consisting of two parts VIZ. a-Yodhya.The first part
has a negative meaning, and the second is derived from that root yudh
, the meaning of the whole word being ' impregnable'. That this is
only correct interpretation is absolutely clear from the context in
which the word occurs.
Thus what the above-quoted mantra 31 means to say is that the body
(pur) wherein the Purusha resides is impregnable (a+yodhya), having
eight chakras (ashta-chakra) and nine doors (nav-dwara).
Coming to your point about Ayodhya and whether this is the city of Dashratha as mentioned in Valmiki and other Ramayana and Puranas etc. , here in the mantras you quoted the human nature or human structure is symbolically called as "Ayodya" meaning of which is impregnable or not easily capturable or defeatable , if we know about its Wonderful structure , capabilities , characteristics, powers etc.
The Ayodhya puri (city) mentioned in mantra no. 31 is actually the human structure called the city of gods or Swarga known also by various other names as "Brahmapuri, Brahmanagari, Amaravati, Devanagari and Ayodhya etc. These names are metaphorically used for our structure in Vedic literature. But in puranic texts, these are separate abodes of deities.
The purpose of the mantras is to covey us the message that our body we ourselves and our structure is impregnable to any of the vikaras like Shadripus( six obstacles). Our body is a great stronghold and it is unable to be captured or broken into by outside destructive forces if we make use of the specialities and powers of ourselves. We do not want to go much outside to get to swarga. The Swarga itself is inside us because the Paramatma resides in it. Our body is his dwelling place, and that is why this puri (human body) is impregnable'. We just need to realise this fact.
Here is Hindi explanation of this mantra by the renowned author
Pandit Shree Ram Sharma Acharya. It is clear from his translation of the sukta that this Ayodhya is the Human body in which Brahma resides and is non-breachable.
Dr. Sripad Damodar Satavlekar in his Atharva Veda Ka Subodh Bhashya is explaining the above in much detail which is in Hindi. And here is his actual
translation of mantra.
Note- For those who can not read Hindi the explanation provided by B.B.Lal is in the link above and explanation of all other authors in the answer is relatively same with no difference.