Adding a form to Views Bulk Operation for configurable operations
Instead of running a PHP script. You would have to create a custom module and a custom Action. The action may be configurable (requiring a Form) and you can check the form for errors before proceeding.

An example template of what would go into your .module file can be seen at ( am not the author):
http://dropbucket.org/node/841

In case that website is taken offline, here is the code sample, which I believe to be self explanitory:

/**
 * Implements hook_action_info().
 */
function custom_action_info() {
  return array(
    'custom_action_callback_name' =&gt; array(
      'type' =&gt; 'entity', // Can be file, term, user, etc.
      'label' =&gt; t('Your label'),
      'configurable' =&gt; TRUE, //  Needs config form
      'behavior' =&gt; array('view_property'), // Uses view access rights
      'triggers' =&gt; array('any'), // Works always
    ),
  );
}

/**
 * Return a form definition so the action can be configured.
 */
function custom_action_callback_name_form($context) {
  // Set default values for form.
  if (!isset($context['recipient'])) {
    $context['recipient'] = '';
  }

  $form['recipient'] = array(
    '#type' =&gt; 'textfield',
    '#title' =&gt; t('Recipient'),
    '#default_value' =&gt; $context['recipient'],
    '#maxlength' =&gt; '254',
    '#description' =&gt; t('The email address to which the message should be sent OR enter [node:author:mail], [comment:author:mail], etc. if you would like to send an e-mail to the author of the original post.'),
  );

  return $form;
}

/**
 * Validate custom_action_callback_name form submissions.
 */
function custom_vbo_action_send_node_validate($form, $form_state) {
  $form_values = $form_state['values'];
  // Validate the configuration form.
  if (!valid_email_address($form_values['recipient'])) {
    form_set_error('recipient', t('Enter a valid email address.'));
  }
}

/**
 * Process custom_action_callback_name form submissions.
 */
function custom_vbo_action_send_node_submit($form, $form_state) {
  $form_values = $form_state['values'];
  // Process the HTML form to store configuration. The keyed array that
  // we return will be serialized to the database.
  $params = array(
    'recipient' =&gt; $form_values['recipient'],
  );
  return $params;
}

/**
 * Add action callback where you perform the action. 
 */
function custom_action_callback_name($entity, $context) {
  // Do the magic here.
}


EDIT

If you just want VBO validation rules and no form for your action, look at VBO Validation which supplies easy to use Hooks.