Yes and No.
The Player's Handbook (Revised) cites the DM as the ultimate arbiter. Specifically, at the end of "The Combat Sequence" section in Chapter 9:
The above sequence is not immutable. Indeed, some monsters violate the standard sequence, and some situations demand the application of common sense. In these cases the DM's word is final. [Emphasis added] PHB(R), p. 124.
However, according to strict RAW, what you did is not legal. The Combat Sequence,
Within a combat round, there is a series of steps that must be followed. These steps are:
- The DM decides what actions the monsters or NPCs will take, including casting spells (if any).
- The players indicate what their characters will do, including casting spells (if any).
- Initiative is determined.
- Attacks are made in order of initiative. PHB(R), p. 122.
Under #2 Player Determination, the rules specifically state, "Spells to be cast must also be announced at this time and cannot be changed once the initiative die is rolled." [Emphasis added] (p. 124)
However, D&D is collaborative storytelling. Your DM and your group have flexibility in how you apply "common sense" as used above. The PHB(R) gives the example of a party attacking a mixed group of goblins and ogres. The players must state whether they are attacking goblins or ogres, but do not need to specify the individual monster. But, what happens if you pick goblins and they are all killed before your initiative? Do you lose your attack that round, or does common sense say that you can change your attack? This is something your DM and your group need to discuss and decide.
In the Night Below boxed campaign I played years ago, we house ruled that players' attacks started on their unmodified or modified initiative roll, whichever was lower, and finished after their weapon speed or casting time. Therefore, a character could change their action as long as they had not yet started it.
Putting numbers in your example, if the mage announced a melee attack with his quarterstaff (weapon speed 4) and rolled a 7 for initiative (no other situational/magical modifiers), our group interpreted this as the mage starting the melee attack on 7 and finishing on 11. If the bullywogs incapacitated the other wizard before 7, then the mage could change his action to casting sleep (which would go off at 8 due to a casting time 1) since he had not started his attack. Of course, this house rule also applied to enemies so they changed their combat actions if it benefited them.
I have also played in AD&D 2e campaigns where the first part of the above house rule was used, but any changed action happened after all other first attacks of the round. Using the same bullywog example, the mage's sleep spell would go off after every creature's first attack, but before any second attacks, instead of on 8.
Neither house rule seemed to unbalance combat as it applied equally to both players and NPCs/monsters. We still lost a couple of characters and had to get a couple of others resurrected. However, allowing changes to combat actions can make it last longer in real time, especially bigger battles with many enemies.