Well - There is an app called Tasker that lets you script some items, but there is now an app called AutomateIt which provides a more intuitive way to automate actions on your Android Device.
Find AuotmateIt on the Android Markeplace
Find out more on Tasker at LifeHacker