Hello Mark,
The USFM looks correct, it all looks good.
There is a reason why the header "Doxology" is highlighted together with the verse preceding it.
The highlighting is applied to a given verse number.
The editor, in this case, simply highlights everything from the markup "\v 23 " till just before the markup "\v 24".
And so the "\s3 Doxology" is included in this fragment, because it comes after \v 23 and before \v24.
Teus.