functions.php and conditional tags

functions.php is part of the loading process and way too early for conditional tags to work reliably. Any conditional logic should be hooked to and executed no earlier than template_redirect hook.

For scripts on front-end wp_enqueue_scripts is appropriate hook.