It may be possible if your ship is reset when you change guns. But it will be impossible to be able to change weapons on the fly, such as in the middle of a fight. If you are really concerned about the money, then it would be a lot more viable to just make the sell price a lot closer to the buy price.