I use this script from Ben Rollason. It does a great job.
Ripple
It’s very basic….there are no instructions or help… but it will do what you want.
Install it in your scripts folder. It won’t work as a docked panel / script UI.
Select top level comp, change duration setting of this comp manually. Run the script, click ‘Ripple’. The duration setting of the top level comp will be rippled down through all subcomps and layer lengths will be adjusted accordingly.
Robert Hoisan
Motion Graphics Artist