How to set all values of a field as body classes
Instead of reinventing the wheel, you could take a look at Display Suite.  DS has this functionality built in.

DS comes with a sub-module (DS extras) that has a feature that allows users to select a style right from the node edit page.

After enabling ds, ds_ui, ds_extras you can enable /admin/structure/ds/list/extras -> Other Tab -> View mode per node to use the feature.

Description of the feature:


  Change view modes for individual nodes. A new tab 'Display settings'
  will appear on the content create form. You can also pass the name of
  a view mode through the URL, eg node/x?v=full. If you install the Page
  manager module and override the node view, Page manager will win.


Update: If you still want to do it the way you started, you can just change this bit to use a foreach:

Change:

if($term = field_get_items('node', $node, 'field_layout')){
  $vars['classes_array'][] = drupal_html_class(reset($term));
}


To:

if ($term = field_get_items('node', $node, 'field_layout')) {
  foreach ($term as $item) {
    $vars['classes_array'][] = drupal_html_class($item['taxonomy_term']-&gt;name);
  }
}