By what stretch of the imagination is this a "snippet"?
Did you even read Where should I post X?
Looking @ it from a _great_ (no; I mean really great. Greater than that even...) distance this looks just like a snippet...
I like what your doing - even though you posted it in the wrong place... ;->
Adding some configuration mechanism seems like something you want to do since all your checks are now hard coded and most can quite easily become soft coded.
I make decisions, and my brain carries them out
My brain makes the decisions, and I observe them (if I'm lucky)
I make some decisions, and my brain makes others
My spouse makes decisions and I and my brain carry them out
I wrote a program to relieve me and my brain from the burden of decision-making
The black-helicopter people project the decisions into my brain and then I do as ordered
Results (488 votes),