var docRef = app.activeDocument;
var layerRef = docRef.activeLayer;
var layerName = layerRef.name;
var newTextLayerRef = docRef.artLayers.add();
newTextLayerRef.kind = LayerKind.TEXT;
newTextLayerRef.move(layerRef, ElementPlacement.PLACEBEFORE);
newTextLayerRef.textItem.contents = layerName;