http://wiki.hydrogenaud.io/index.php?title=Foobar2000:Title_Formatting_Reference
file:///C:/Program%20Files%20(x86)/foobar2000/titleformat_help.html
especially:
file:///C:/Program%20Files%20(x86)/foobar2000/titleformat_help.html#other and first operator: [ ] can be helpful.
Using these operators and variables you can format displaying of titles in foobar playlists accordingly to your wishes (how they are displayed there in foobar - not how they are written to file - you will always have there just file path when saving to .m3u). For example you can create custom column (Preferences -> Display -> Default User Interface -> Playlist view) with code:
$if($meta(artist),%artist% - %title%,%filename%)
This will check if tags are present (here: a tag with artist name) and if yes, then it will read artist name and track title, and if not - it will just display filename - not question marks. You just need to click on columns header on playlist view, disable columns from default config and enable the one you have created. You can make those functions nested and do more complicated analysis. My code for "Artist - Title" column is:
$if($and($meta(artist),$meta(title)),$meta(artist) – $meta(title)[ '('$meta(subtitle)')'],$if2($meta(title),$if($meta(artist),$meta(artist) – '['%filename%' (>>>tags missing!<<<)' ']',%filename%' (>>>tags missing!<<<)')))