You have noticed a small bug in your data processing script and now you have to redo all your plots for your thesis? latex+gnuplot scripts+makefile, and a few seconds later you have a new pdf.
\ifx\ispreambleloaded%
\relax%
\else%
\def\isstandalone{}%
\input{preamble}%
\fi
% ... content ...
\ifx\isstandalone\end{document}\fi%
and the preamble.tex would look like: \documentclass{scrbook}
% ... all the other stuff that goes in the preamble ...
\begin{document}
\def\ispreambleloaded{}%
(Note: Recounting this all from memory, so I may have gotten some stuff wrong.)