We retaliated and played the same game that India tried to start and claim. However, while Pakistan retaliated; there are Indian losses and world has already seen them. Speaking of all out attack, is not the case nor feasible. To understand strategy as such; you can see that there are few or almost none of parties buying Indian fallacy at all. Concern parties have seen what we can do and without much damages to India, the message is delivered with a shocker that for next time, enemy will think more than twice before any misadventure.
Nobody can claim that there will be no losses in case of war or at-least a longer clash but, Pakistan has made sure that we will give an unsustainable blow.
You can't risk & wait for the enemy to come in and then you will sink that Sub. Anything could have happen hence, preemptive measures & pulling her out like a helpless fish. It will be too childish to say that we should have attacked xyz military installations, damaged this & that or should have sunk few IN ships/sub. The world would have been blaming us being aggressors & in view of Indian propaganda machine; Pakistan couldn't come out of this as we have more enemies than friends in the West/US.
Pakistan did the right thing and nobody is blaming us. What we did; was the message that never cross the line again. Strategic thinkers & men with responsibilities, have more foreseeable reasons to act in calculated & well measured manners as such.