I'm with you on that one, Nob. Fortunately, there's a linguistic out.
I don't remember the episode stating what they were using to do the sweep with, so it could be they were sweeping for
baryons ...specific ones ...specific molecular collections of them. My point being that English has several idiums that no longer make sense in today's context but still have the old meaning. (I'm suddenly blanking on examples. I had three when I started writing.) "Baryonic sweep" could easily be a 24th century example.
In the 24th century, I would guess the ship would go through a barionic sweep to get rid of any dangerous particles, trim trilithium to core coolant. (Remember what happened to the Borg when they got exposed?) This would make the vessel completely inert and ready for storage, if that were her fate. Any useful systems could then be identified by engineering teams, disconnected and beamed off the ship. If she were to be scrapped, large chunks would then be carefully cut off her and pushed through an industrial replicator that would take the individual molecular components and separate them into large blocks of that material to be used again.
In the 23rd century, when I assume they did not have baryonic sweeps or replicators of that sophistication, a phaser set to vaporize might be the best answer: any dangerous compound would be turned into it's constituent elements, making it inert. One should easily be able to extract much of the energy used by exposing the resultant plasma to an electromagnetic field of the right shape. And then the individual elements could be separated via another set of mag fields. Easy!