maybe timing
you might want to check your timing belt. I had the same problem with my 98 civic. it wouldnt go over 4000rpm. after i looked at my belt i realized that it had somehow jumped two teeth. so it was readjusted and a valve adjustment was done (becasue it was making a ticking sound for some time) and it has ran fine ever since. just a note from personal experience.