Would bad spark plug wires cause a check engine light?

I just changed the valve cover gasket on my car. Then when I tried to start it, it started violently shaking and the check engine light turned on. The only thing I could think is that maybe the spark plug wires broke when I took them off. Would that cause a check engine light? It's a 2002 Ford Focus ZTS with 150000 miles

My guess is that you did not put the plug wires on the right cylinder or that you unplugged a sensor and did not plug it back in yet.

HI, you could still have them on the wrong plugs if the motor is a V8 or V6 and you didn''t follow the order of the motor. On some V8 motors the driver side is 1234 and passanger side is 5678 and on some the driver side is 1357 and the passanger side is 2468. And on some #1 is on the left bank and on some #1 is on the Right bank.
So you could still have them off. That's what it sounds like anyway

You put the leads back on the wrong plugs. That's why it's misfiring and bringing up the light.

It is safe to say whatever is making the engine shake like a wet dog is responsible for the light, and I would believe the spark plugs and wires are high on the suspect list. Even a little bit of that nonsense will set the check engine light with misfire codes (P0300-P0304).

More likely you plugged the wrong wire to the wrong coil/plug

Quite possibly yes. If the outer lining of the wires is old and brittle, it would have cracked and make the spark jump out of the side and ground on the block somewhere without ever reaching the spark plug. Try getting a new wireset.

If you took the wires off, perhaps you did not put them back on correctly. There's a prescribed firing order and if the plug wires are not put on the proper spark plug it will cause a misfire resulting in violent shaking.

If you're sure the wires are properly installed it's possible the removal and flexing caused internal damage check with ohm meter… Or
you left off or broke a vacuum line or cracked the pcv valve elbow… Check the code… I've seen crossed wires give fueltrim codes not misfire, but on a four I'd think the crank sensor might sense it as such.double check everything before you toss parts at it…
Obviously, the wires length will only allow them to go to the right plug… But maybe on the wrong coilpak terminal.

If you're sure it's wired properly, get your code read for free at your nearest auto parts store. It will tell you a cylinder is misfiring. Switch the wire from that cylinder with the wire from another cylinder and read codes again. If the problem moves, then change the wire. If it stays put, then the problem is something else.