The following minimal example produce the typical "Something's wrong--perhaps a missing \item" error. I can't understand what's wrong with loading xgalley together with the use of \addvspace...
\documentclass{article}
\usepackage{xgalley}
\makeatletter
\newenvironment{test}
{\par}
{\par
\addvspace{\baselineskip}% <--- error...
%\@endpetrue
}
\makeatother
\begin{document}
\begin{test}
abc
\end{test}
\end{document}
Adding \@endpetrue didn't help, as suggested in \addvspace{x}\noindent ... \addvspace{x} doesn't work.
The above example can be made smaller by just making a call to \addvspace rather than placing it in an environment.