Should I throw away my pan if I accidentally melt plastic on it?
You do not need to throw out the pan

Metals tend to be impervious to absorption of much in the way of plastics (or anything else), which is part of the reason they make great cooking implements.

If the plastic is on the cooking surface and that surface was seasoned, to be absolutely sure, I would recommend that you remove the seasoning and re-season.

If you touched the outside of the pan to the bag, then anything that remains after you peeled the plastic off will burn off next time you heat the pan.