Switch to admin theme based on path using hook_init() or template.php in Drupal 7
The Administration theme module will do it, but given you'd like to do it yourself, it does cast some light on that path by suggesting the hook_admin_theme_check() and hook_admin_theme_info() hooks.