There's actually onscreen precedent for building things like starships using something like transporter technology: Genisis.
Spock stated to McCoy that Genisis "would destroy such life, in favor of its new matrix." It's a easy to see that Genisis would make use of transporter technology to beam in the old matter and reorder into a "new matrix" that was selected by the user.
Of course, things didn't work so well on a planetary or solar system scale (though somehow it worked well enough to bring Spock back to life and his body was stable for decades), but given the success it did have, building a starship in a similar method would be trivial.
With that kind of thinking, they couldn't have justified decommissioning the enterprise, they'd just beam a new airlock onto the side of her, beam/swap out some hull plates and she'd be good as new. You guys are throwing some waytoofancy tech at TOS, given what we saw in the films (which were admittedly retro in a lot of ways relative to the series.)