How can I programatically get the cart's dollar sum of drupal commerce?
You should have it already.  That call to "commerce_line_items_total" returns the array:

return array('amount' =&gt; $total, 'currency_code' =&gt; $currency_code);


Thus you should have the total price at $total['amount'] since you already have $total['currency_code']