Ship invention is a bugger of a thing. Unlike module invention, there are a lot more considerations to take into account because the cost and thus risk is so much higher.
The big question is what decryptor to use? For ship invention, its almost always more profitable to use a decryptor to increase the number of runs and/or quality and/or chance of success but they are expensive. Do you spring for the one that gives +9 runs but drops the material efficiency to -6 and drops your chance of success by 40%? Or do you go for the one that adds 5 runs, drops efficiency to only -5, but increases chance of success by 80%? Or something inbetween?
In the end, for my 7 invention jobs to try and get Onyx BPCs from Moa BPCs, I settled on User Manual which leave the odds of success alone, but gives a -3 ME and +2 runs for three runs per success. Out of 7 attempts I'm hoping for at least 2 successes.
7 Decryptors @ 11 mil = 77 million
56 Mechanical Engineering Datacores @ 350K = 19.6 million
56 Caldari Starship Engineering Datacores @ 210K = 11.76 million
== ~108.4 million ISK
Assuming 2 success for 6 runs
== ~18 million ISK per run.
If I get lucky and get a third success, the cost per run drops to around 12 million. If I get unlucky and get no successes, my cost per run is infinite :P The old adage holds true: don't try to invent what you can't afford to lose.