Set "Use the administration theme when editing or creating content" to true in install profile
Setting it is as simple as:

variable_set('node_admin_theme', 1);


Most (not all, but most) config settings used in Drupal are managed using a system_settings_form(), which basically takes the array keys of the elements used in that form, and saves them as variables.

So an abridged version of the theme settings form would be

function some_form($form, &amp;$form_state) {
  $form['node_admin_theme'] = array(
    '#title' =&gt; t('Use the administration theme when editing or creating content'),
    '#type' =&gt; 'checkbox',
    '#default_value' =&gt; variable_get('node_admin_theme', 0),
  );

  return system_settings_form($form);
}


When Drupal processes that form, a variable called node_admin_theme is created/updated with the appropriate value.

If you're certain a form is using system_settings_form(), finding the names of the associated variables is as easy as inspecting the elements themselves and looking at the 'name' parameter, e.g.



If you're not sure, lookup the function that defines the form and check. If it does use system_settings_form() then great, and if not you get an insight into how that form actually manages its data.