Yes, using the system variable %_counter% there is no need to set up a user defined counter variable.
Right after a closed loop the system variable %_max_counter% provides the maximum count of the last loop.
I would code the report like this ...
(maybe it would be more safe to replace the semicolon delimiters by the tab character $char(9))
2: $loop(%_filename_ext%)'"'%_counter%'";"'%TITLE%'";"'%ARTIST%'";"'%ALBUMARTIST%'";"'%COMMENT%'";"'%ALBUM%'";"'%TRACK%'";"'%YEAR%'";"'%_length_seconds%'";"'%_file_size_bytes%'";"'%COMPOSER%'";"'%_folderpath%'";"'%_filename_ext%'"'
3: $loopend()$repeat($char(13)$char(10),$sub(17,%_max_counter%))
4: '"Check";"Total Files";"Size in Bytes";"Total Size";"Total Time";"Total Time in Seconds";"Date"'
5: '"'%_max_counter%'";"'%_total_files%'";"'%_total_size_raw%'";"'%_total_size%'";"'%_total_time%'";"'%_total_time_raw%'";"'%_datetime%'"'
You have to take into account the known quirk of the Mp3tag Export Scripting Language.
Each line of code in the report script itself, creates a linefeed in the report output file.
There is no way known today, how to suppress these unwanted linefeed output.
Regarding the example script from above, there are 3 lines to be subtracted implicitely (20-3=17), to get the totals section exactly into line 20 (valid for %_max_counter% <= 17).
DD.20120616.1020.CEST