There is no good solution for this, not even when is just a simple recursion problem, on top of that when you add multiple BOM Revisions and manufacturing routes it gets even worse.
The only way I would approach this will be probably with a well designed set of custom records and a couple of chained map reduces to update those records.