Hmmm....how did you determine that the keyway was worn? Need to get a better handle on when the clatter occurs and disappears.
i had the same-ish noise at idle only. it would clack. is yours at idle only? it was one of the cam sprockets (i think the intake) that had developed a worn keyway (maybe belt was too tight for too long). the cam belt tension varies as the engine turns and the valves actuate. at idle the cam would get pulled to close one valve then slap back. had to buy a new pulley to cure it.