in reply to Need help separating logic from display

To put it simply, I'd keep doing what you're doing but change the order slightly. Put all of your markup into your templates (it only get's confusing to the person coming behind you if you put some in your templates and other bits in your perl code) and then pass any needed variables into your template but don't worry about passing form input values.

Then process your template, catch the output and then send it through HTML::FillInForm, and then return that output to the browser. This is actually what the CGI::Application::Plugin::ValidateRM does for you when it creates the error output after a form doesn't validate. Your code might look something like this:
my $tmpl = HTML::Template->new(....); $tmpl->param(%non_form_stuff); my $output = $tmpl->output(); my $fif = HTML::FillInForm->new(); print $fif->fill( scalarref => \$output, fobject => $query, );