This is a spin-off question to Change vertical space of chapters temporarly in Table of Contents. Like in the question's answer, I managed to achieve custom vertical spacing of chapters before, during and after the main content.
In contrast to that question, I'm using memoir's \frontmatter, \mainmatter and \backmatter commands to separate these document parts semantically.
Now: Is it possible to move the vertical spacing commands for chapters to the preamble somehow, e.g. by using the \*matter commands as a trigger? I really would like to keep the custom formatting commands out of the document body as far as possible.
MWE with desired output, but with markup sprinkled throughout the document:

\documentclass{memoir}
\usepackage{etoolbox}
\setlength{\cftbeforechapterskip}{3pt}
\begin{document}
\frontmatter
\tableofcontents
\chapter{Foreword}
\chapter{Abstract}
\mainmatter
\pretocmd{\chapter}{\addtocontents{toc}{\addvspace{6pt}}}{}{}
\chapter{Chapter One}
\section{Section One One}
\section{Section One Two}
\section{Section One Three}
\section{Section One Four}
\chapter{Chapter Two}
\section{Section Two One}
\section{Section Two Two}
\section{Section Two Three}
\chapter{Chapter Three}
\section{Section Three One}
\section{Section Three Two}
\section{Section Three Three}
\section{Section Three Four}
\section{Section Three Five}
\backmatter
\appendix
\chapter{Appendix One}
\pretocmd{\chapter}{\addtocontents{toc}{\addvspace{-6pt}}}{}{}
\chapter{Appendix Two}
\chapter{Appendix Three}
\end{document}

\*matter*commands. using a "patch" technique is what i'd look at, but i'm not familiar enough withmemoirto suggest code. – barbara beeton Jun 21 '15 at 12:25