this is hard to answer without seeing it. yes, shims might be a
possibility, though if your studs lean this way and that, the shims
would have to be tapered...takes some skill to cut 8' long tapered
shims. a lot of times, it is faster to just redo. even if the ceiling
is already drywalled, can you remove the studs and then then top plate.
fill the hole where the top plate was with a scrap of drywall, and put
your new plate on the surface of the ceiling drywall. another thought
is to put new wider studs along side the existing screwed up studs,
sort of firring both sides out in effect.
the other option is to just leave it. wood studs are seldom straight,
and after framing a wall, if you lay a straitedge across them, it is
typical to see variations of 1/4 to even 3/8" this isn't that
noticeble in the finished product--unless you are putting cabinets
good luck and don't forget to learn from your mistakes!