This article really just scratches the surface of shell scripting within the Mac OS X environment. As you can see, to be an effective shell script programmer you have to be familiar with the Unix command line within Mac OS X, and to accomplish that, may I suggest my book Learning Unix for Mac OS X Panther from O'Reilly? Once you've mastered it, I have another book that has more than 100 interesting and illuminating shell scripts (all tested on Mac OS X, too) called Wicked Cool Shell Scripts.
Good luck to you and have fun scripting! The completed script for this article is available online at http://www.intuitive.com/wicked/bitranch.itunesinfo.txt.
If you encounter any problems, please feel free to check out my online library of scripting information at the Wicked Cool Shell Scripts site or visit my Q&A site http://www.AskDaveTaylor.com/, where you can see many more script examples and ask about new ones, too!