You don't actually need a script to do this. Each 3D layer has several controls in the Material Options section for determining if and how they accept shadows. Either open the 3D layers and switch off the Cast Shadows option for each of the layers you don't want to cast shadows. Or, you can stop a layer from accepting shadows by turning off the Accept Shadows option.
Hope this helps,
Angie Taylor animation & illustration for television, film, web and devices