My friends think that it is 5 seconds closely guarded, dribbling or not, so in my previous scenario a violation would be called 1 second into the dribbling. One of my least favourite rules, by the way, but you understand it. I always thought that the 3 second call is off when a player attemptes a shot. You are correct, the count is over once a shot goes off, but of course, the whistle doesn't always go off before the ball is released. The problem with the three second rule is that those niggly little details do not mean much.
Referees generally call three second violations based on the spirit and intent of the rule.
In reality, a player should touch both feet outside the lane before reentering. But if the player gets themselves out of that vertical space marked by the lane lines, they have really met the intent of the rule. If a player is straddling the lane line and lift the foot in the lane but makes no attempt to draw the foot back outside the lane, you would likely continue the count. If there was, it is a violation. A female co-worker says that in women's NCAA basketball, the offense has no time limit in the backcourt.