Checking if personal contact form exists
This is taken from contact.module:

function _contact_personal_tab_access($account) {
  global $user;

***snip***

  // If the requested user has disabled their contact form, or this preference
  // has not yet been saved, do not allow users to contact them.
  if (empty($account-&gt;data['contact'])) {
    return FALSE;
  }

***snip***

  return user_access('access user contact forms');
}


You should be able to see in the user object whether or not they have they are allowing people to contact them. This will also be empty if they don't have a contact form.