my escort 1.8 used to do that, and it was an on going saga for 6 months
finally found it was the plastic inlet manifold which was leaking.
is probably down to an air leak, could be idle control valve sticking... no air is getting through, and then it cuts out.
spray wd40 around your different vacume hoses and roundthe inlet manifold - see when the revs climb!
is it all right once you've driven it for a couple of miles and the engine temp is up?