One way would be to get pipe the o/p and filter out the last line and get the no of deleted messages from there & assign it to a variable.
Code:
no_of_msgs=$(mailq | grep -v "^[^0-9A-Z]+" | grep MAILER-DAEMON | awk '{print $1}' | postsuper -d - | tail -1 | awk '{print $3}')