It is unlikely that your Croton needed it's most recent repotting. It should not be in a pot that takes a "loooong " time to dry out. It is during that extended time that the roots are deprived of oxygen and start to decay, further feeding the gnat larvae and ultimately killing the roots system and the plant. It is good that you removed the loose soil from the surface, but a mistake to replace it with gravel that will maintain the moisture level that the larvae are enjoying. Peroxide has no effect on the larvae and also just adds to the moisture level.
I suggest that you undo the repotting, but only if the rootball is still intact so that you can easily remove just the contaminated soil that you added and then move it back into its previous pot.
NEVER, under any circumstances, remove all or most of the soil as that will not only remove the gnat larvae but also damage most of the root system and probably kill the plant.
The only drainage strategy you need is a pot that is not too large and has a drain hole and a potting mix that incorporates lots of perlite so the potting mix is porous and dries out appropriately about once per week.