OK, that is exactly what the mod already does (only the animation remains "delete" and does not show selling the ship)
Side note: The mod does not provide store-specific credit (which I believe is ok), i.e. when returning a ship, you are getting back a fraction of resources for general purpose. Store credit would mean you get a reduction for your next ship.
The remaining question is if a building needs to be garissoned with at least unit in order to allow deletion (mimicking arson). I still have doubts on that concept: burning down your building does definitely not give back much useable resources.
Requiring a person to be in placed inside the building to be destroyed appears counter-intuitive to me (this is already strange with a manned tower or siege engine: the crew survives destruction, other than for a ship where they sink together).