thinking out loud here.... if it's not behaving after doing all this mechanical work.....
the ECM detects knock by watching the Knock Filter (mounted on pass fender). When the knock filter drops below 9V, the ECM generates knock counts and knock retard.
There's always a possibility of a wiring issue (damage, corrosion, loose, etc) in the wiring between the knock sensor and the knock filter, or between the knock filter and the ECM, or the knock filter power and ground feeds.