The rule for this is so vague really - leaves so much up for interpretation. IMO, the best way to officiate it is, does it look like the player was show boating, or being unsporting in any way. If yes, whack him. If not, play on and maybe let the player know if we was close to crossing that line....
The craziest part about the technical on a dunk is....it only has to do with the rim. A player can windmill, 360 spin, go through the legs, behind the back, throw it off the glass, bounce it high off the ground - virtually complete what would equate to a dunk contest style dunk and there is nothing wrong or against the rules about it. But hang on the rim for .5 seconds too long and bang, technical is coming! Just doesn't make much sense in the grand scheme of things really.....