Here's mine. I am not sure how to format this without breaking it.
$truncate($if2(%albumartist%,%artist%),143)/$truncate($if($if2(%originaldate%,%date%),$left($if2(%originaldate%,%date%),4) )%album%,143)$if(%discsubtitle%,/$truncate(%discsubtitle%,143))/$truncate($if($gt(%totaldiscs%,1),$if($gt(%totaldiscs%,9),$num(%discnumber%,2),$num(%discnumber%,1))-,)$if($ne(%tracknumber%,),$if($gt(%totaltracks%,99),$num(%tracknumber%,3),$if($gt(%totaltracks%,9),$num(%tracknumber%,2),$num(%tracknumber%,1))),) %title%,138)
I think the truncations are necessary to avoid exceeding filename length limits on some systems. The if2s are to fallback to another field. Similar to yours, there is also logic for zero-padding as needed on discs and track numbers and to omit discs when there is only one.https://picard-docs.musicbrainz.org/v2.7/en/extending/script...