In my technicians opinion, hmmm...well metal shavings coming from the near the filter area would be internal components not having proper lubrication to cool the parts down. Sounds like someone didnt do an oil change til it was down to the very last quart of oil. You may have warped parts as well, (valvetrain and bottom end). Its very hard to judge from the actual source without looking at it.
I would suggest a new motor, it will save you grief and dispair without any worries of future parts wearing abnormally, but if you cant afford one, you might want to consider what we call "overhaul" engine build. It uses slightly used engine components and saves you some dough, but in the long run, there is no "guarantee" to last as long as brand new OEM engine.
I would not encourage junkyard blocks for something you would use and rely on for transportation.
2009 Cobalt LS XFE U74
Mods: K&N Typhoon Intake, Option Cat-Back Exhaust, Cosmo Short shifter, Maxxim Ahead 17X7's, MPx shorty antenna, FE5 Strut/shocks, Tein S Techs, Moog endlinks, Moog spring seaters, ZZP shorty header, LSJ downpipe, LNF front grille