Hi Nima,
ns_sendmail when invoked opens a connection to the server's mailhost (127.0.0.1 by default) and sends the message using SMTP. So ignoring anything which directly inserts into qmail's outgoing queue (not sure this happens any more), every mail goes through ns_sendmail. Problem is, ns_sendmail only takes the To: address as a parameter and not a party ID. So to do the check here, I guess you'd need to look up the party ID using the email and then check the dont_spam parameter. I suppose that if you have to go to the database to check the parameter anyway, then the extra effort of looking up the party from it's email address is minimal, but I personally would be a little worried about incurring a DB hit per mail sent, as I think on high-volume sites this might be a serious performance issue.
I think maybe a better place to perform the check would be higher up, e.g. in acs-mail, though again I believe most of these still operate with email addresses not party ID's.
Tom