I’ve never been a professional actor but, going back to acting class, doing plays when I was younger, etc. I feel like there’s a middle ground between “Will Smith going into rage mode” and “It was staged.”
If you’re able to do improv and you’re performing then the agenda is to create entertainment for the audience. Entertainment - other than naked hotties, explosions, and jokes - is drama. Smith was there in the front row, he could walk up there quickly and get back, a fellow performer gave him an opening to do something dramatic, and (potentially) he knew the guy well enough to understand that he would realize that 30% he’d actually pissed off Will but 70% the cameras created a good moment to create a memorable moment for the show.
It was real and it was also - in that moment and by the understanding of the improvisational nature of the persons involved - generated as an impromptu staged occurrence.
Smith targeted the level of smack, the amount of trash talking, etc. to all fit inside a soundbite and not truly harm Rock in any way. He got revenge for his wife, created a perfect moment of TV, and helped to boost Rock’s image. It was a perfect chance for the heist, where he could get away with it, and he used his talents as an entertainer to pull it off, knowing that he would get away with it because it was great TV and no one had truly been hurt.