I also had an issue with the wrapping, it was besause of the quotes around color_palette_grid. Try removing and typing them again after pasting the line.
if (!function_exists(‘color_palette_grid’)) {
by the way, the theme got updated by the developer, but didn’t solve this issue. Pretty weird.