Yes indeed. I was trying to say that you cannot set layer's visibility during the import phase but later (like just after the place command) once the file has been placed onto the layout.
var f = File ( Folder.desktop+"/layers.pdf" );
var pdf = app.activeDocument.pages[0].rectangles.add().place( f )[0];
pdf.parent.fit ( FitOptions.FRAME_TO_CONTENT );
pdf.parent.move ( [0,0] );
var layers = pdf.graphicLayerOptions.graphicLayers;
var layerA = layers.itemByName ("LAYER A");
var layerB = layers.itemByName ("LAYER B");
layerA.isValid && layerA.currentVisibility = false;
layerB.isValid && layerB.currentVisibility = true;
