I'm not a programmer, but I find the export configuration function in mp3tag to be quite powerful for maintaining and reporting on my podcast collection, and so I muddled through. What I've found through trial-and-error is you should think about the $loop more as a sort function. This is not based on any real knowledge, rather on my reading of the output from many dozens of my hand-built export configuration files.
The $loop parameter, the %album% in $loop(%album%), sorts your mp3tag listing before executing your export code. For example, $loop(%album%) sorts your mp3tag selection by album, then executes your export code line by line on the results.
$loop(%dummy%) would execute your code based on your last manual sorting operation. $loop(%album%)$loop(%title%) sorts your mp3tag listing first by title, then by album, and then executes your code (note the reverse order).
$loop()$loop()$loopend()$loopend() does NOT execute your code twice. It merely sorts twice then executes your code once. To execute code twice use $loop()...coding...$loopend() $loop()...coding...$loopend().
If you have an export configuration that should execute differently depending on how the mp3tag listing is sorted, then you should use %dummy% as the $loop parameter. For example, I use an export configuration to print out playlists. For podcasts that need to be listened to in order, I first sort manually by track and then run the export configuration. For podcasts that can be listened to in any order, I first sort manually by random.
This at least is how I see it. I welcome any clarifications.