It was offensive goaltending - if any portion of the ball is over any portion of the rim, it's illegal to touch it. Just frame-by-framed the replay and although the ball was clearly on its way out, about 1/4 of the ball was still over the rim when Shaq tapped it.
This wasn't what cost us the game, but it sure didn't help.
EDIT: Nope, I'm wrong. Rulebook says: "Players ARE allowed to tap, touch or rebound a shot attempt when the ball has rolled to the outside edge of the basket ring and no longer has a chance to score." The shot was partly over the rim, but clearly on its way out, so it's a legal tap. I misunderstood the rule.
TP to Samuel Adams for posting it.