What you say makes much sense to me, but Memory-Alpha doesn't seem to agree with you:
Act Three
...the batteries open fire on the Enterprise but the shields are able to turn aside the sneak attack. Without the shields they would have been destroyed. Looking for options to respond to this unprovoked attack, Scott decides to respond with a barrage of photon torpedoes, but Ambassador Fox halts any attempt at retaliation.
General Order 24: An order to destroy all life on an entire planet. This order has been given by Captain Garth on Antos IV, Captain Kirk on Eminiar VII and Admiral Simon Reeger on Argus II. On none of these occasions was the order actually fulfilled. Kirk called it an order of last resort while arguing with Reeger about it.
Act Four
Kirk hails the Enterprise informing them to standby to transport the party in ten minutes or carry out General Order 24 on schedule.
So I see it as an actual threat in response to an actual threat, which Kirk was hoping would break Anan7's resolve. Fortunately, the threat didn't need to be carried out, but evidently it was indeed real.