How to override logic of specific drush command? I'm aware of validate/pre/post COMMAND hooks and I would like to replace the logic of the existing drush command on specific condition using policy commandfile with something else, e.g.

/**
 * Implementation of drush_hook_COMMAND_validate().
 *
 * Validate feature revert of specific module.
 */
function drush_policy_features_revert_validate() {
  if (strpos($args[1], 'rules') !== FALSE) {
    drush_invoke_process('@self', 'rules-revert-all');
    drush_print('Rules reverted in custom way!');
    return drush_set_error('POLICY_DENY', dt('Rules features already reverted.'));
  } 
}


However the problem is when I return TRUE - the command which I want to override is called after than, on the other hand when I'm returning FALSE, the drush will fail with non-zero exit code which could cause some other issues (like breaking the deployment).

Is there any better way of overriding the logic of existing drush command without described side-effects? Secondly validation hook doesn't sound right to implement that kind of logic.
Actually returning just FALSE without drush_set_error should work fine without error and the original command isn't executed, e.g.

/**
 * Validate feature revert of specific module.
 *
 * Implementation of drush_hook_COMMAND_validate().
 *
 */
function drush_policy_features_revert_validate() {
  $args = drush_get_arguments();
  if (strpos($args[1], 'rules') !== FALSE) {
    drush_log(dt('Reverting rules...'), 'ok');
    drush_invoke_process('@self', 'rules-revert-all');
    drush_log(dt('Reverting of rules finished.'), 'ok');
    // drush_postflight(); // Set context as completed, but this is not needed.
    return FALSE;
  }
}