As far as I know, there are multiple ways to get the soil back. Still assuming you’re playing on 0.F+, the probably easiest/cheapest option is to construct
Make Gravel Floor, followed by the
Remove Gravel construction.
If this doesn’t work (it might has changed over the versions), you might want to use the
Deconstruct Furniture on the gravel floor, which should leave a pit that you can fill in with a shovel.
Alternatively, you can use the
Build Roof Over Dirt Floor… That requires adjacent (supporting) walls or roofs though, which takes a lot of material to construct.
No. As far as I’m aware, intruders – be it monsters or NPCs – can’t beat or dig through ceilings (yet).