Actually, that flag (and all similar-looking flags) merely classifies the ship as a certain type for use in the ship-type-destroyed operator. The game will not work if a ship exists without the flag, but that's all it really does.
Anyway, I once tried to do something similar to this but it took up too many events and SEXPs to be of any practical use. (due to the SEXP limit) Basically, it can work by placing an asteroid ship type in the mission, having the gas miner fire its beam at it, and using ship-vanish on the asteroid when it gets to 10% or so hull.
Incidentally, Homeworld has an asteroid mining effect that looks similar to what you might be talking about.