If you're comfortable with scripting, you may want to write your own android app to do just what you need. Just make sure you buy an android phone that can install non-market applications. To test this in the store, ask to see a running phone of the model you're considering, and follow this procedure:
1. From the main screen, tap the menu button.
2. Tap Settings.
3. Tap Applications.
4. Look for a checkbox that says "Unknown sources - Allow installation of non-Market applications", and make sure you can enable it.
I realize this solution isn't for everyone. You would have to learn Java if you don't know it and learn Android programming, which isn't that hard. Otherwise, you could set up a special server with a regular OS and run your scripts there. If there are exceptional conditions, your server scripts could send an email to a special email address. You can quite easily configure your android phone to play a special ringtone when your "exceptional condition" email account has new mail.
As far as easily attaching sounds to an email, you may have to roll your own app for that. Someone more knowledgeable than me may know of an app to do this, though.