Drupal 7 Form AJAX button to return javascript script
The AJAX callback is only used to tell Drupal's AJAX engine what part of form to update. All actual work of building the form elements is supposed to happen in form's hook, in code wrapped in a control statement like the following.

if (!empty($form_state['values'])) {
  // ...
}