I figured out a near solution that I think is actually probably better than what I was trying to accomplish.
The new item in my Search menu is tentatively named "Title (album • title)", with the code
"Title (album • title)" -> title = "fmt_title2" ? title ~ ""
It's the same code as the original Rockbox "Title" item except for the new name and the reference to the new formatting string.
The new formatting string (which does the new magic that I need) is
%format "fmt_title2" "%s • %02d.%s" album tracknum title
which produces a list of albums and titles with tracknums, primarily sorted by album and secondarily sorted by tracknum. By including the album name it is less ambiguous than what I was originally shooting for, and for my purposes the sorting is more logical and useful than the original Rockbox Title search. I will use it when searching for things like an Op. (Opus) number or K (Köchel) number that will produce a number of hits - typically 3 or 4 per album in the list - that would be more logically ordered by album first and then tracknum rather than solely by track number (which is what the original Rockbox Title search does).
(As usual, I made a misstatement in my original post where I said I was looking for primary sorting by album and secondary sorting by title. It should have been secondary sorting by tracknum.)