Help fixing / cleaning up talking toaster alerts

I have a raspberry pi modded into a toaster shell with speakers, and a text to speech engine that gets commands via ssh from openhab to let me know of different events in the house. I have a rule that states when any of the door sensors change from closed to open check to see which door, if silent mode is off then pass the text to the toaster to announce the event, if alarm mode is enabled then send me a text as well.

I my issue is that my method is horribly coded and prone to errors since I am just using multiple if statements cobbled together. Can someone help me clean this up so that it only finds the door that was changed and triggers the commands for that door not just the doors down the line if they happen to be open as well.

Hastebin config link

I would create a different rule for each event, rather than combine them all into one rule

rule upstairsFrontDoorOpen
                Item Upstairs_FrontDoorStatus changed from CLOSED to OPEN
		if (SilentMode.state==OFF) {
	                executeCommandLine("/home/toaster/ \"Front Door Opened\" ")
                if (AlarmMode.state == ON)
                        logInfo("Alarm","Alarm Triggered" + DoorName + Upstairs_FrontDoorStatus.state)
			sendMail("", "Upstairs Front Door", "Opened!")

Having a separate rule for each trigger event would avoid the extra alarms you are getting at the moment.

I was trying to group it but in the interest of keeping it simple and reliable I might just so that. Thank you.