Well, that depends.
Is this a war? Or is this a police action?
The difference being that one is an existential conflict for your way of life and/or life itself as a people or country, and the other being a situation where overwhelming power can be brought to bear against a transgressor and the question is how to do it to avoid further transgression but also avoid collateral damage.
If this is a war, then far, far more is at stake than just the lives here; unless you can achieve lasting peace before it's time to make the strike, and if the strike is of sizable practical importance, you order the strike.
If this is a police operation, you shouldn't be using airstrikes, for the most part. You use SWAT tactics instead: get as many hostages out as you can, and only if the people inside are in greater danger from the terrorists than from your intervention do you proceed with overwhelming but measured force. Otherwise you wait them out, and let them surrender if they choose that instead of fighting.
One wonders what the pricetag and manpower needed would be for a policing operation. Wars are conducted like wars because when you're under significant duress, you have to be efficient. Policing is comparatively expensive. But I'm not entirely convinced that Israel, with help at least, couldn't manage it, if it were a long-term goal.
Part of Israel's fault is that they let Hamas dictate that it is a war. But Hamas, for its part, has also taken many steps to make it a war-like rather than policing-like conflict.
It is in the setup to the problem that leaves only bad choices available today. Hamas' bargain with Israel is: "We will murder your civilians or make you murderers of civilians." Israel's bargain with Hamas is: "Fine with us. Your move."
Alas, Hamas moved.