Use denoiser on certain frames of animation
Ended up with this code, where denoiser starts working on specific renderlayer only on certain frames.

import bpy

scene = bpy.context.scene

def denoiser_control (scene): 
if scene.frame_current in list(range(66, 90)) + [1, 20, 50]:
    bpy.data.scenes["Scene"].render.layers["RenderLayer"].cycles.use_denoising = True
else:
    bpy.data.scenes["Scene"].render.layers["RenderLayer"].cycles.use_denoising = False

bpy.app.handlers.frame_change_pre.append(denoiser_control)


range(66, 90) stands for some frame range and [1, 20, 50] defines single frames.