Am I right in the assumption that the "lower" you go in system security (with Anarchy being the lowest) the cheaper the ships become?
No. There are two factors only: rarity and techlevel. Ships can be in any shipyard in the galaxy over the required techlevel of the ship, just can take long time to find a rare ship.
Imho not worth to downgrade your ship, simply cost too much. While it is not the best for combat try to do other jobs to gather enough for repairs. Worth to learn how to avoid trouble, like save fuel (and in-game time!) with short jumps to always keep your injectors usable. Small cargo space is not a problem if you trade valuables which only take 1t space from 500kg. Parcel contracts are also good if you can run away well from clean assasins. I think in this way you will be in a good combat ship sooner than if you do a downgrade then want upgrade back once.