We have compared the ground-state energy of several observed or proposed ``$2\sqrt{2}\ifmmode\times\else\texttimes\fi{}2\sqrt{2}$ oxygen ordered superstructures'' [``herringbone'' structures (HS's)], with those of ``chain superstructures'' (CS's) (in which the O atoms of the basal plane are ordered in chains), for different compositions $x$ in ${\mathrm{YBa}}_{2}{\mathrm{Cu}}_{3}{\mathrm{O}}_{6+x}.$ The model Hamiltonian contains (i) the Madelung energy, (ii) a term linear in the difference between Cu and O hole occupancies which controls charge transfer, and (iii) covalency effects based on known results for $t\ensuremath{-}J$ models in one and two dimensions. The optimum distribution of charge is determined, minimizing the total energy, and depends on two parameters which are determined from known results for $x=1$ and $x=0.5$. We obtain that on the O lean side, only CS's are stable, while for $x=7/8$, a HS with regularly spaced O vacancies added to the $x=1$ structure is more stable than the corresponding CS for the same $x$. We find that the detailed positions of the atoms in the structure and long-range Coulomb interactions are crucial for the electronic structure, the mechanism of charge transfer, the stability of the different phases, and the possibility of phase separation.