I am thinking of writing a class file for this, but a basic problem is stumping me.
I have a document with numbered sections in which a particular section (say section 23) always contains a certain content (which may be dynamically generated from data provided by the user - say a histogram).
To make it concrete (this is for a grant proposal class - its not all code):
23. Deliverables and timelines
\begin{figure}[!h]
\includegraphics[width=\textwidth]{ganttchart.pdf}
\caption{Gantt chart for the proposal.}
\label{fig:gantt}
\end{figure}
< A table summarizing some fixed information regarding the proposal. >
One user supplied sentence relating requested financial support to the deliverables.
I want to write a class file that automatically generates such sections (there are several) for the user. How does one go about something like this? I have written classes before, so I am not entirely unschooled in this, but how does LaTeX handle something like this? ("This" being creating a section at the correct location in the document and placing predefined elements in it.).

'Found WHAT?' said the Duck.
'Found IT,' the Mouse replied rather crossly: 'of course you know what "it" means.'
'I know what "it" means well enough, when I find a thing,' said the Duck: 'it's generally a frog or a worm. The question is, what did the archbishop find?' ''
– Przemysław Scherwentke Jun 30 '14 at 08:41\printmewhere they want the specified stuff to reside (akin to\tableofcontentsor\printbibliography). This would include setting up some content in the preamble (say) (akin to\titleand\author); (3) Patch your sectioning command to perform (2) exactly at the right time... – Werner Jun 30 '14 at 18:05