Add inline style to pages where shortcode was used

In this case, has_shortcode() is your friend.

First, we hook into wp_print_styles, instead of wp_head. In the func we hook
we check if the post contains our shortcode. If it does, we get the CSS we want and output
it as an inlined <style>.

add_action ('wp_print_styles', 'wpse_enqueue_shortcode_css') ;

function
wpse_enqueue_shortcode_css ()
{
    global $post ;

    if (is_single () && has_shortcode ($post->post_content, 'my_shortcode')) {
        $append_css = get_post_meta ($post->ID, 'append_css', true) ;

        echo <<<EOF
        <style type="text/css">
            $append_css
        </style>
EOF;
        }

    return ;
}