Adding to this idea;
Instead of dismantling the ship you're selling, why not change it's faction to the faction you're selling it to, this way you could sell built ships to other factions. It will also allow you to sell your ship, and then try to take it back. which of course, if it's a rather powerful ship, will be extremely risky and fun.
Method:
1. Find a shop and exit the ship.
2. Leave ship dimensions (while still staying in range of it, much like the shop's range).
3. F-target the ship you're selling.
4. Sell to the shop (with price bartering, all those shiny bits)
5. Confirm sale and enjoy your new credits.
Of course, depending on the size and power of the ship you could have a 'Labour cost' meaning a ship you spent time building will sell for a greater amount than the sum of it's raw materials.