Yes, do get the codes.

If the cam position sensor code (P0340) is still there, static timing or the sensors ability to read the timing is the problem. This can be the belt, loose sprocket, VCT.
As far as I know, VCT was installed on 1998 2.0L I4 engines. There is a TSB for it, and it is becoming an increasingly common problem.

Missing is normally caused by a spark problem.

Too high/too low wandering idle is usually a vacuum leak.

Very bad running up to at least 3000 rpm and maybe beyond, shakey feel, loss of power, and sometimes periodic sucking and or muffled popping sounds, usually mean a timing problem.


"Those who cannot remember the past are condemned to repeat it" -George Santayana