My old mobile phone had a 'silent' mode: no ring and no vibrate. Alarms also wouldn't play when the ring was muted. To create similar behavior on the iPhone, I created five seconds of silence in GarageBand (iLife '08), and installed it as a ringtone. I used GarageBand because it's convenient.
This let's me have a 'silent' alarm using my silent sound as the ring tone with the phone unmuted, or a vibrate-only alarm when the phone is muted with the silent sound as the ring tone.
Mac OS X Hints
http://hints.macworld.com/article.php?story=20080615074937126