I was trying to re-invent the wheel this week by writing an index creation script / procedure using the dynamic views provided by Microsoft in my 2k5 database.
After looking in BoL and other sources for what the columns really meant in the dataset, I decided to search SQLServerCentral.com and see if anyone had already done this. (Note to self: Do this step first next time)
I stumbled upon this script, which promptly made me throw out my script and give this procedure a whirl. Take a look.