The following shell script will launch a radio station (in RealOne Player) and put the computer to sleep after an hour. In this case, it will open the 6 Music radio station. Saving this script as myname.command allows it to be executable from the Mac Finder:
#!/bin/sh
say 'Opening 6 music'
open rtsp://rmlivev8.bbc.net.uk/farm/*/ev7/live24/6music/live/6music_dsat_g2.ra
sleep 3300
say 'Sleeping in 5 minutes'
sleep 300
say 'night night'
osascript -e 'quit application "RealOne Player"'
osascript -e 'tell app "Finder" to sleep'
Remember to make the script executable (chmod 755 scriptname).
Mac OS X Hints
http://hints.macworld.com/article.php?story=20050115181950246