Ideal gas law when diatomic molecule is about to break into constituents Suppose we have a diatomic molecule. Its center of mass has an average kinetic energy given by
$$
\frac{1}{2} (m_1 +m_2) v_{cm}^2  = \frac{3}{2}k_BT
$$
and using this we can derive the ideal gas law
$$
PV = n k_BT
$$
where $n$ is the number of molecules. We do this by thinking about how much momentum is transferred per unit time and the equipartition theorem.
At temperatures high enough that the atoms break apart, they do not move together and the same computation has to be repeated for each of component atom. The ideal gas law is still the same but if we still denote the number of molecules as $n$ then the number of atoms is $2n$ and we get
$$
PV=2nk_BT
$$
My question is what happens during the transition? What happens when temperatures are high enough for the diatomic molecules to not completely break apart but the constituent atoms to move away far from each other?
 A: 
What happens when temperatures are high enough for the diatomic molecules to not completely break apart but the constituent atoms to move away far from each other?

Atoms in a molecule can't move away from each other without the molecule breaking.
The chemical bond acts like a spring and once we add enough energy to the molecule to overcome the bond energy, the molecule breaks.
As a very rough approximation:
The equipartition theorem says that each degree of freedom of a molecule has equal average energy. A molecule has $3$ translational degrees of freedom.
The diatomic molecule has $2$ rotational and
$$f_{vib} = 3n_{at} - 5 = 1$$
vibrational degree of freedom (where $n_{at}$ is the number of atoms in the molecule). Since the harmonic oscillator has potential and kinetic energy, the vibrational degree of freedom is for the purpose of equipartition theorem double-counted, which gives us number $2$. Together with rotational degrees of freedom, we have $4$ degrees of freedom that contribute to stressing the bond, and $3$ translational degrees of freedom.
From that follows that $\frac47$ of energy given to the molecule will be expended on stressing the bond.
The energy given to the molecule before it breaks apart is equal to bond energy. Since the bond acts like a mechanical spring with certain stiffness which breaks when the molecule gets energy greater or equal to the bond energy, we can see that we can't stretch the average bond length to an arbitrarily high extent without the molecule breaking (even though we can stretch it to some extent).
So at any moment, we'll have two or three mixed gasses - the diatomic molecules, the monoatomic molecules of one kind and the monoatomic molecules of the second kind. For each component, the ideal gas law holds separately, so
$$P_{\text{molecules}}V = N_{\text{molecules}}kT$$
$$P_{\text{atoms kind 1}}V = N_{\text{atoms kind 1}}kT$$
$$P_{\text{atoms kind 2}}V = N_{\text{atoms kind 2}}kT$$
A: I went ahead and solved it. The details of the calculation have been posted on my blog but the main point is the following. 
I assume a diatomic molecule made of the same atoms connected by a spring with spring constant $k$ to make things simpler. Working in the com coordinates $x$ and the relative distance $y$ the partition function of a single molecule in one dimension is
$$
Z_1 = 4 \int_0^{L/2-y/2} dx \int_0^L dy e^{-y^2/X^2} \\
=X^2 \left( \eta  \sqrt{\pi} ~erf( \eta) - (1-e^{-\eta^2}) \right)
$$
where $X=\frac{2k_B T}{k}$ is a length scale corresponding to the typical distance between the atoms and $\eta= \frac{L}{X}$.  
We have put a subscript to denote that this is the partition function in 1 dimension for 1 molecule. Thus the full partition function is
$$
Z={Z_1}^{3n}
$$
and we will henceforth write $L$ as $V^\frac{1}{3}$. The pressure is given by
$$
\frac{P}{k_BT} = \frac{1}{Z} \frac{\partial Z}{\partial V}  \\
= 3n \frac{1}{Z_1} \frac{\partial Z_1}{\partial V} \\
= \frac{n}{V} \frac{ 1 }{1 -\frac{(1-e^{-\eta^2})}{\eta \sqrt{\pi} ~erf(\eta)} }
$$
We plot the correction term 

This confirms the intuition behind the question.
