Here's some code that won't work on its own, but should give you some ideas. The layerNameArray stuff shows how you could create an array of layer names. The palette stuff shows how you might implement adding items to a drop down. I imagine that this is something that will need refreshing, so you could first do a removeAll to clear out the list, then loop through the layers adding a new list item for each name.
Code:
{
var activeItem = app.project.activeItem;
if (activeItem != null && activeItem instanceof CompItem) {
var layerNameArray = new Array();
palette.dropDown.removeAll()
for (var x = 1; x <= activeItem.numLayers; x++) {
//$.writeln(activeItem.layer(x).name);
layerNameArray.push(activeItem.layer(x).name);
palette.dropDown.add("item", activeItem.layer(x).name);
}
}
}