I would def. look into the knock sensor code !!! I've had 1 go bad myself and heard many times of them going bad including harness problems!
I also hear all the time my maf is bad and then they try 3 different ones.....never to fix the problem. No saying its not bad just hear that ALL the time.
Is your mechanical timing right???? Its pretty easy to get it off when you jam the thing in there. Took me like 4 tries because you would assume it point to #1 but it actually ends up pointing at #2--> before it. Then again mine wouldnt even run till i got it right.
How about finding the resistance the ecm looks for at idle from the maf and giving it that resistance. <<you could use a fuel lvl. sending unit possibly to change the "signal".
^def. a simplified example theres 6?5? wires going to it incorporating intake temp. ??? eh anyways good luck again
You can also back prob the maf and watch voltage instead of looking a stream from obd2 or use it to reference/compare.
^then if its off mess with the sigal with say a safc NOT A FIX just trying to get ya running here