Even if you select multiple layers, you can get only one. You can get only the last selected layer (the layer on which was the last click). Something like this.
You can record and load/play an action which does the "Hide Others" inside the layers panel. By taking a measure of the visible vs hidden layers before and after this action is ran, you can tell which the selected layers are. Of course, this won't help if some of the selected layers are already hidden. In fact, the action fails if there are any hidden layers selected and this command is used.
That is very unfortunate... and very dev-unfriendly... Makes you wonder what the heck they were thinking when creating ExtendScript.