Isn't that what phpbb_optionset is supposed to do? https://github.com/phpbb/phpbb3/blob/develop/phpBB/includes/functions.php#L4664 

So you could just do:

    $parse_flags = 0;
    $parse_flags = phpbb_optionset(OPTION_FLAG_BBCODE, $user_cache[$poster_id]['sig_bbcode_bitfield'], $parse_flag);
    $parse_flags = phpbb_optionset(OPTION_FLAG_SMILIES, true, $parse_flag);

(Note this is a question)