Unfortunately, the nodes that contain instructions to change the current ink color are not discardable, so you need to bury them inside a \leaders box; this does not allow the use of \leaders that directly employ rules (e.g., \leaders \hrule width \linewidth \vskip ...).
However, it suffices to rebuild the box used in the \leaders each time the \ornament command is invoked, instead of packaging it once for all at the \begin{document} hook, so that it conforms to the current font size. Here is a compilable example:
\documentclass[9pt]{extbook}
\usepackage[T1]{fontenc}
\usepackage{color}
\makeatletter
\newsavebox\@hide@ornament@box
\newcommand*\ornament[1][\baselineskip]{%
\par
\setbox\@hide@ornament@box \vbox{%
\kern \dp\strutbox
\color@begingroup
% \color{white}% for deployment
\color{yellow}% for testing
\hrule
\@width \linewidth
\@height \baselineskip
\@depth \z@
\color@endgroup
\kern -\dp\strutbox
}%
\skip@ #1%
\advance \skip@ -\baselineskip
\divide \skip@ \tw@
% Or:
% \skip@ \glueexpr (#1-\baselineskip)/\tw@ \relax
\nobreak \vskip\skip@
\centerline{$*\quad*\quad*$}
\nobreak \vskip\skip@
\penalty\z@ % breakpoint; adjust penalty value as you please
\vskip -\glueexpr \skip@+\baselineskip \relax
\cleaders \box\@hide@ornament@box
\vskip \baselineskip
\vskip\skip@
\vskip\z@skip % allow for "\addvspace"
}
% \showboxbreadth = \@M
% \showboxdepth = \sixt@@n
% \tracingonline = 1
\makeatother
\newcommand*{\Text}{Blah blah blah:
This meaningless sample text
is used for testing purposes only.
It should be long enough to fill up,
in print, a couple of lines at least.}
\begin{document}
\Text \ornament
\Text \ornament[1cm plus 3mm minus 2mm]
% \showlists
\small
\Text \ornament
\Text \ornament[1cm plus 3mm minus 2mm]
\footnotesize
\Text \ornament
\Text \ornament[1cm plus 3mm minus 2mm]
\normalsize
\Text
\Text
\Text \ornament[4cm plus 1cm]
\Text
\Text \ornament[4cm plus 1cm]
\Text
However, this trick does not work as expected
if a new page is started with an explicit
\verb|\newpage| command.
\ornament
\newpage
\Text
\end{document}
Some remarks:
I am a nasty guy who still loves to play around
with internal LaTeX macros and with TeX primitives,
as you can see from the code.
Instead of loading the extsizes package,
I use the extbook class:
this makes no difference for the issue at hand,
and is recommended.
An optional argument in the \ornament command lets you specify
the amount of vertical space that should be skipped;
the default is \baselineskip, that is, the vertical space
taken up by a line of printed text, in the current size.
The code as it stands draws yellow rules, instead of white ones:
this is done to let you see exactly where those rules are placed.
You should change the code (in the obvious way)
before deploying it.
The code contains (commented out) diagnostic code
that you can activate in order to see exactly what
is placed on the vertical list being built.
Note, finally, that this trick will not work as expected if a new page is started with an explicit \newpage command.
For completeness’ sake, here is a picture of the first page of the output:
