Was Lebron hanging on the rim to "prevent an injury to himself or another player"?
All the Celtics had stopped in their tracks. If LeBron doesn't grab the rim, he lands peacefully with everyone else far behind him. Hanging on the rim is what brought him back toward the other players. In fact, it almost caused an injury since it led to him kicking Marcus Smart in the head.
There is a zero percent chance LeBron swung around on the rim for safety purposes (I'd love to hear somebody attempt to justify that scissor-kick move he performed). James knew he was going to hang before he even dunked, because he enjoys it and that's what he always does.
The NBA clearly has no issue with this, as its official YouTube channel is featuring this highlight:
For all intents and purposes, the above rule no longer applies. Which is fine, but the league might as well just eliminate it since its alleged existence is a joke.
Food for thought: Imagine if this play was reversed.
Smart throws down the alley-oop, swings around in a circle and kicks LeBron in the head. I still think it's only 50/50 Smart might've been whistled for a technical foul, but LeBron would have freaked out, then later complained about the no-call in the the post-game press conference. Today we'd be talking more about Smart's violent temper.