Refactor: scheduler: functionize comparing on-fail values
The action_fail_response enum values used for the "on-fail" operation
meta-attribute were initially intended to be in order of severity.
However as new values were added, they were added to the end (out of severity
order) to preserve API backward compatibility.
This resulted in a convoluted comparison of values that will only get worse as
more values are added.
This commit adds a comparison function to isolate that complexity.