Layers have a name-property that can be changed via Script.
// 2014, use it at your own risk;
#target photoshop
if (app.documents.length > 0) {
var theDoc = app.activeDocument;
var theLayer = theDoc.activeLayer.duplicate(theDoc.activeLayer, ElementPlacement.PLACEBEFORE);
theLayer.name = "test";
theDoc.activeLayer = theLayer
};