The egr valve diverts some of the exhaust gases back into the inlet manifold for re-burn, if the valve get stuck it can cause problems.
The valve is normally bolted to exhaust manifold with a pipe going to it for control. I believe some of the earlier 2.5 BMW engines may not have had an EGR valve fitted.
Have you downloaded the the "Rave CD" if not use search above to find the link.
i cant see it being the fly wheel as this is the original one ,had no probs prior to engine swap,im thinking/hoping it may be a loom plug on wrong as they all looked the same to me ?.