I am also curious how that can be done. I enumerated the properties of Camera Lens Blur and they are these:
Blur Focal Distance
Invert Blur Map
Use Linear Working Space
And the Layer must be a number. I tried setting it to a 2 sized array. Like 1 for first and 2 for second, but that did not work. I also tries setting it to mask property of another layer thinking that maybe After Effects would transform it into a correct value. That did not work either. Looks like that value does not exist for scripting.
I'm mostly trying to make a little script to speed up adding a bit of depth of field to a scene. Was hoping to generate an adjustment layer with the Camera Lens Blur attached and a solid above that with a Gradient Ramp set up as the Blur Map.
I guess I could try adding a shape layer with a gradient fill instead?