Hello! Sorry, I didn't get the question completely, but here's what I can say...
These two verbs IR and SER are unfortunately conjugated the same way in the past = FOI (changing for each subjec) which causes a bit of confusion. In the examples you gave:
• Foi inventando - foi (the past of IR, in this case) indicates that someone kept doing something. In a context:
- E ele foi inventando mentiras.
The translation would be: "and he kept/followed making up lies".
• Foi inventando - foi (the past of SER, in this case) indicates the way someone did something. In a context:
- Foi inventando mentiras que ele conseguiu o trabalho.
The translation would be: "It was by making up lies that he got the job". If you put it in the present, it makes more sense because you can see how SER is used instead of IR:
- É inventando mentiras que ele consegue um trabalho.
The translation would be: "It is by making up lies that he gets a job".
• Estava inventando - estava (the imperfect tense of ESTAR) indicates an action in the past that is not necessarily over. In a context:
- Ele estava inventando mentiras para conseguir um trabalho.
The translation would be: "He was making up lies to get a job".
I hope this is useful, your doubt was really complicated, but I tried my best. Your interest in Portuguese is admirable. Bye :)