check the IAC. maybe it`s fouled.
the 4000 rpm limit is "produced" from the knock sensor IIRC.