If you loop by %_folderpath%, then you get first the files from one folder and then the files from the second folder.
I would think that either looping by %title% and then by %_filename% would get an output like you described.
Or you sort the files already correctly in the files list select them and use an export script that uses $loop(1) which keeps the order of the files in the files list.
To add further information, see the help for other properties variables:
Perhaps %_file_size_bytes% ist that what you are looking for.
I do not see that the $loop(1) and $loop(2) loops go to the next file.
I would think that is should be enough to have just 1 loop $loop(%_filename_ext%)%_directory%//%_filename_ext% %_file_size%$loopend()
My assumption: you have the same title in both files - so sorting by title is taken care of at the beginning.
Now you have a list of titles, each with a filename - now loop (sort) by this filename to output them both.
Try to get the logic right and then add the html stuff.
if you want to get 2 files next to each other in an export then it has to be possible to do just that in MP3tag without the export script.
If you then use the export script, it is possible to use a special sorting order, other than that of the files list - this is described by the $loop() statements - or you use the same order as in the files list - this then requires the rather special statement $loop(1) (which means "please sort the number 1" which does not do any sorting at all but takes the files in the order as found).
So either you have the list ready with the 2 similar files next to each other - or you have to sort it in the export script.
So which way is your's?