
http://aescripts.com/trim-to-layer-above-and-trim-to-layer-below/
Trim to Layer Above will trim the layers that are selected to be the same length as the layer above it. Trim to Layer Below, well, trims the layer below the selected layer.
Trim to Layer Above will trim the layers that are selected to be the same length as the layer above it. Trim to Layer Below, well, trims the layer below the selected layer.