4000 revolutions is probably the rev number of maximum torque, which means at these revolutions the engine pulls in the most air and thus the ignition coil voltage required to jump the spark gap is the greatest throughout the rev range. So the first suspect would be a traditional failing ignition coil, but if changing those doesn't fix it, the problem could also be a failing HT lead or a spark plug (I give the spark plug the least probability to be the problem).
But then about the failing speedo? Could it be just a coincidence? But if the problems are related you have to find a common nominator for the two problems. Maybe a bad earth connection. So check the engine bay earth connection between body<->engine, body<->gearbox, etc. I think there are around four earth straps at least? Maybe someone has more insight on this. Also, is the speedo working while the engine is misfiring? If it is working, then the problems are probably not related. But it could also be a bad power feed to the ECU and when the ECU loses power it shuts off the speedo and the spark?