The On-Update statement will run after a message is processed, even if it errored on a destination. If you want to conditionally update based on an HL7 NACK, you can do that in the On-Update statement, but it would probably have to use JavaScript. Or, you can do this in a postprocessor:
if ($r('Destination 1').getStatus() == 'FAILURE' && /.*MSA.[AC][RE].*/.test($r('Destination 1').getMessage())) {
// Update the database here
}