I would like to be able to trap when a particular message is sent via drupal_set_message
In Drupal 6, messages are themed for display via...

function theme_status_messages($display = NULL) {
  $output = '';
  foreach (drupal_get_messages($display) as $type =&gt; $messages) {
    $output .= "&lt;div class=\"messages $type\"&gt;\n";
    if (count($messages) &gt; 1) {
      $output .= " &lt;ul&gt;\n";
      foreach ($messages as $message) {
        $output .= '  &lt;li&gt;'. $message ."&lt;/li&gt;\n";
      }
      $output .= " &lt;/ul&gt;\n";
    }
    else {
      $output .= $messages[0];
    }
    $output .= "&lt;/div&gt;\n";
  }
  return $output;
}


In Drupal 7, they are themed similarly via...

function theme_status_messages($variables) {
  $display = $variables['display'];
  $output = '';

  $status_heading = array(
    'status' =&gt; t('Status message'),
    'error' =&gt; t('Error message'),
    'warning' =&gt; t('Warning message'),
  );
  foreach (drupal_get_messages($display) as $type =&gt; $messages) {
    $output .= "&lt;div class=\"messages $type\"&gt;\n";
    if (!empty($status_heading[$type])) {
      $output .= '&lt;h2 class="element-invisible"&gt;' . $status_heading[$type] . "&lt;/h2&gt;\n";
    }
    if (count($messages) &gt; 1) {
      $output .= " &lt;ul&gt;\n";
      foreach ($messages as $message) {
        $output .= '  &lt;li&gt;' . $message . "&lt;/li&gt;\n";
      }
      $output .= " &lt;/ul&gt;\n";
    }
    else {
      $output .= $messages[0];
    }
    $output .= "&lt;/div&gt;\n";
  }
  return $output;
}


so I'd imagine copying the appropriate function into your theme's template.php and naming it YOURTHEME_status_messages(...) along with some suitable regexing or strposing inside would do the trick pretty directly.