Hello I will help you with your question,
How many miles on your Sonata?
Do you know if the timing belt has been changed?
Check the motor mount at the top right side of the engine by opening the hood and rocking the engine bak and forth in reverse and drive with your foot on the brake. these are known to go bad and cause vibration.
Was there any oil in the plug wells when you changed the wires? Did you change the boots on the coils or just the wires? What brand of spark plugs did you use?
I am not familiar with who is making AZs plugline but Hyundais are pretty picky about their plugs an only like NGK or Denso as a rule. I dont think this is all your shake, these were never the smoothest engines but if this is not the third timing belt and balance shaft belt you need to get that changed as soon as possible. when the belt teeth strip off the valves will be damaged. The balance shaft may be out of time due to the teeth stripping off its drive belt or may have been put back out of time on an eariler belt replacement so change the belts and the mount at the same time.
If the code was for the cat it may need to be replaced as the misfire may have melted it but that would show if you rev to 2500 and held it there it would start to choke
The first step I would take is to have the codes read and check the mount.
Plan on replacing the belt and mount if the belt has not been changed.
Let me know what codes you come up with