Most Forges can hold 8 units of product in stock. When they have 4, the price is the same as in ED, and when they have 8, the price is at rock bottom. But when they have 8, they will halt. (The halting may not be completely true for NPC Complex, which has multiple products, not all full.) Since most Forges produce only one unit per cycle, it will be enough to buy their products, when they have 7 in stock. There is no point buying before they have 7.
All is needed is a Commercial Agent (CAG) in a station that can buy weapons. That is HQ or Dock (preferably Trade Dock). And credits on station to pay. One CAG can cover the whole universe. If it gets too busy, one can add more. If one uses a Dock, it fills instantly. Even the HQ will fill up quickly. One can try to sell to NPC Docks, and if they cannot take all, stockpile surplus into Mammoth and visit suitable NPC Dock occasionally.
So how to get the CAG buy when NPC has 7/8 in stock? Adjust price. Look at the price, when Forge has 6. You must set your price below that value. Look at price, when Forge has 7. That is the minimum price, and the real price you'll ever pay. The ED price is much higher, so you get nice profit when you sell the guns back.

But setting prices is the tedious part. First figure the acceptable price, and then use the interface to reach it. Awful.

Anyone gone through any part of that hassle yet?