At the end of first three quarters if the game-clock is lower than shot-clock the team with possession should always take a buzzer-beater and not give opponent additional chance. In fact shot-clock violation is better than taking a shot with 3s left. I don't mind "mistakes" at the end of the game since players in RL tend to make them as well but "brain farts" in the first 3q are very rare.
If it's not too much coding it would be greatly appreciated!