Commerce: how can I execute javascript after a product has been added to the cart?
You should better use Rules here and the related events. The hook you mention (hook_commerce_cart_product_add) is a rules event hook.

Commerce Cart: After adding/removing a product to the cart


Then on the action add with php the js (drupal_add_js()) but if you simply want to show a message there is an action to do this easily.

System: Show a message on the site