The first guy who played the genie in this show was a great comedian and improved most of it. When they changed guys they gave him a script using some of the jokes made by genie #1, but people wanted the improv back so now they can make up some of it. There are of course lines they have to follow, if you notice he has cue lines, there are certain parts where the genie is allowed to make things up then at the end he says the cue line and the next character knows to speak now
Every Genie, had a script of 16 Jokes they could pick from and were also given free range to go off script for short parts. In one show, which is on RU-vid, one of the Jafar actors was leaving, and as a tribute, the Genie did all 16 Jokes.