To reiterate from above posts:
Sounds like the internal HDD ribbon cable may be getting flaky on you.
The best way to "breathe new life" into the MacBook:
1. Install and SSD
-and-
2. Install a new drive ribbon cable.
Go to ifixit.com to see what's involved.
They'll have the cable part number there (either get it from them or online or ebay).
Opening up a 2012 MacBook to swap drive and cable is EASY, but...
Be sure to use THE RIGHT TOOLS for the job.