Wow. I was trying to write this exact tool 2 days ago. Thing that stuck me was how to pick the user name. There's no easy way from the API to figure out what the OS image name is and map it to a default user.
How about using tags to store the default user name for each AMI? Then you could modify this script to look up the username before connecting.