How do I check if the form is an add/edit/delete form?
You could use what said in this answer, with a slight modification.

function example_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  if (strpos(request_path(), '/add') !== FALSE) {
    $page = 'add';
  }
  elseif (strpos(request_path(), '/edit') !== FALSE) {
    $page = 'edit';
  }
  else if (strpos(request_path(), '/delete') !== FALSE) {
    $page = 'edit';
  }
}