I suppose there are quite many ways to do this.
One would be:
Create the Custom Action as In Reaper Action List, you can see here:
https://i.imgur.com/7IXYHBg.jpg
Navigate to menu Extensions > Command parameters.
Fill in desired pixels for the parameter "Height A"
The pixel amount will determine the vertical zoom in amount of selected Folder track and it's children tracks.
If you want to have a toggle zoom behaviour, you can make a Cycle Action from the Custom Action, insert a Step command and then after that insert the Action SWS: Undo Zoom.
Beware, for the Custom Action to work, you have to have the free SWS extensions installed:
http://www.sws-extension.org/
Workflow:
- Select a Folder Track and execute the Custom Action.
- Outcome: The children track of the Folder Tracks will also be selected and these
children tracks and folder Track will be vertically zoomed in by the set amount of pixels.
You can use the Action : SWS Undo Zoom to undo the zoom.
(btw: I assume what you want is even scriptable )