Sound like your fuel/air ratio is not correct.
possibly low oil or low oil pressure, the tapping may be coming from the oil operated hydraulic lifters.
have the Fuel injectors checked out.
when stopped at red light or when in park
What makes you think it's valve noise? How's your oil pressure? If you only have a light, does it flicker or just plain turn on when the engine is hot and idling? If it's an oil pressure gauge, is the oil pressure down near the bottom during idle? If you have poor oil pressure and the engine is making a tapping noise when you accelerate hard, it
Vacuum hose leaking.
bums
First off, you need to know that the throttle body is clean. If the throttle body is not clean inside, the PCM (computer) will have difficulty controlling the idle motor. Next, you need to know that the battery hasn't been disconnected recently. If the battery has been disconnected and the engine hasn't been run for a half hour since reconnecting the battery, your computer will have difficulty controlling the idle motor. Now that you've got that part taken care of, lets go on. If you often have difficulty starting the engine but you can start it easily by lightly tapping the accelerator pedal while you turn the key, you probably have a bad idle motor. Do you have a stalling problem and the stalling only happens when you are stopped and the transmission is in gear, and especially if this only happens with a cold engine or only with a warm engine, consider if tapping the gas pedal prevents the stall? Does the engine seem to run very smoothly except for just before the stalling? If so, you probably have a bad idle motor. If your radiator is full and the heat works normally and you have no vacuum leaks but the engine idles very fast with a warm engine, try tapping the idle motor with a plastic screwdriver handle. If tapping the idle motor slows down the idle speed, you probably have a bad idle motor.
When you here a rattling noise from the engine at idle.
Have valves adjusted.
1998 rav4 engine wont idle and clacking noise from under timing belt cover
Added info to question: Vacuum also coincidently went from steady 20psi to 15psi/knock - small backfire/miss on acceleration from idle. Knock is steady at idle.
Have you checked your Exhaust Muffler and pipes ? Probably the fuel pump