See an older thread:
Sort library by length of title (or author, etc) ?
The one there is for Title length alone though. I'm ignorant about template functions - maybe someone else can help you total similar template for author with the one for title all in one template.