Open development environment for Ruby on Rails 3

I have been using applescript to open my development environment. No typing… love it. I wonder if everyone is doing this? I put the whole thing here in case there are some other folks who could use it. Anyway, as you can see below, one click…

  1. opens the console
  2. changes to my rails app directory
  3. opens textmate
  4. changes ruby version using rvm
  5. starts the rails server
  6. opens another console tab
  7. changes to the stylesheet directory
  8. changes the ruby version
  9. enters the sass watch command
  10. then it is supposed to open another console tab (this isn’t working)
  11. changes directory
  12. changes ruby version
  13. delays 4 seconds (to give time for the rails server to fully initiate)
  14. then opens Firefox to localhost

For some reason the third tab doesn’t open.

tell application "Terminal"
   activate
   do script "cd web_sites/railsproject" in front window
   do script "mate ." in front window
   do script "rvm 1.9.2" in front window
   do script "rails server" in front window
	
   # THIS NEXT LINE IS NOT WORKING
   tell application "System Events" to tell process "Terminal" to (keystroke "t" using command down) activate
   do script "cd web_sites/whozou/public/stylesheets" in front window
   do script "rvm 1.9.2" in front window
   do script "sass --watch stylin.scss:stylin.css" in front window
	
   tell application "System Events" to tell process "Terminal" to (keystroke "t" using command down) activate
   do script "cd web_sites/whozou" in front window
   do script "rvm 1.9.2" in front window
   delay 4
   do shell script "open -a Firefox http://localhost:3000"
end tell

I thought about opening another tab in the console to set up my ssh connection to the production server but am wondering about whether leaving the connection open for hours poses a security threat. Not the main question but feel free to comment on this.

Thanks for your help.