The main difference between a flat engine configuration and an inline configuration is complexity of manufacture and parts count.
In an inline 4 or 6, you have 1 valvetrain and cylinder head to manufacture per engine. In a flat 4 or 6, (or V 6 or 8, for that matter) you have 2 sets of heads and valves and cams to manufacture. This can also increase relative weight but only slightly. The main advantage of a flat layout that Porsche takes advantage of is center of gravity and packaging. If you tried to put an inline 6 in a rear mounted position, it's going to extend too far behind the axles. Alternatively if you mounted a rear inline 6 transversely (E to W vs N to S of the vehicle) you could likely fit in if it's not too big, but maybe not. It will also raise the CG relative to a flat configuration in either transverse or longitudinal layouts. A V8 would be a possibility, and there are several V8 911 swaps out there to prove the concept. Chevy LS series V8's work better for this relative to say the new Ford Coyote V8s because the OHC's in Fords make the engines wider and more top heavy relative to the OHV LS series engines. Maybe go OLD school kraut and make an inverted OHC V8 like the old DB601 aircraft engines? Heh.
Inline 6's really are about the best configuration when you look at them. Good vibration characteristics, easy to build, good power, can be built REALLY strong, etc etc. Why BMW ever went away from them for their small M cars is beyond me.
Alternatively, doing permutations of inline 4's would be interesting from a manufacturing perspective. Inline 4 > double that to Flat 8 > redo that to a V8 (see some of the 500HP double Suzuki Hayabusa engines out there, as in the Ariel Atom V8s) > inline 8 with center camdrive and gear drive for power to offset the torsional crankshaft vibration problems of the old pre-war inline 8s > Flat and V 16s for the crazy stuff. Start with a 1.5 Liter inline 4 with a turbo and then just add the previously mentioned permutations for various applications. The difference is just the block... other than the inline 8 and 16 cylinders.