Drush scripting fails on call to drush_pm_enable()
The Drupal and Drush bootstrap processes are fairly complicated things; it is best no to try to figure out how to call them yourself.  If you want to bootstrap and call arbitrary PHP code, you can do so using Drush via drush @mysite ev 'php code here'.

As for calling Drush code directly, you should use drush_invoke_process, just as you are for the site-install command.  So, instead of drush_pm_enable(), instead use drush_invoke_process("@self", "pm-enable", array('ctools', 'views', 'views_ui')).

However, if you are running site-install on an installation profile, you should not need to call pm-enable, as the installation profile should take care of that for you.  If you're not sure how to build an installation profile, you can have Drush generate one for you.  You'll need to use the prototype generate-profile command, which can be found at http://drupal.org/node/1368242.  It does not work for D6 sites yet, but works fine for D7, so should be good for your purposes. Take a look at the list of modules generated in your profilename.info file; these will be enabled for you during site-install.