Although it is indeed the goal of shooting the last second, in real life players also shoot often sooner.
Some reasons? They can't see the shot clock, they get tricked by the opposing fans, they refuse to pass to a teammate or they're just plain stupid.
The final attack management could be coded with taking in account a couple of variables such as experience of players, game score, etc. Maybe it's already even coded similar.
Just don't expect to see your players always obey the best possible rules. There coded to be a bit human after all. :-)
Climbing the BB-mountain. Destination: the top.