For a gas through folding stock I would probably recommend having it follow along the frame of the stock similar to the dog leg on the opposite side of the direction that it folds in. Since most fold to the left side of the gun then it should go on the right side. There should be about two or three inches of coil to allow flex around the stock when folded. It should then go right down the side and then into the gun. IE: the tombstone for an A-5 or the expansion chamber for spyders.
However, keep in mind that most folding stocks may not allow for this due to pinch points and crimps that would be left on the hose. Now a gas through car stock is possible because you would have a length of coil on the instead that would exit near the front like most other gas though stocks. Unless this already exists - I have not seen them because I don't have a need for one.