Punch me if I'm spamming, but if anyone is interested, my first publicly released script for After Effects is here: http://blob.pureandapplied.com.au/first-n-last/
It automates the process of trimming a comp to fit the length of the layers, even if they extend past the beginning and end of the comp. I've packaged it up and put it on the Adobe Exchange thing, but I'm not sure if that will work.
Let me know if you use it, and especially if you have any problems with it. It's open source so if you want to check out my code feel free.