This tool might not be exactly what you propose, but you might find it useful when dealing with lots of tracks. It automatically expands/collapses tracks when changing sequence, depending on if they’re empty or not.
“Auto-collapse empty tracks” in the pattern editor context menu.
https://forum.renoise.com/t/new-tool-2-8-collapse-empty-tracks/34553