The ssget function recognizes all group codes except entity names (group –1), handles (group 5), and xdata codes (groups greater than 1000)
Do you know that DXF 5 is for the Entity handle, which will ONLY apply to ONE entity .. in this case the one saved in variable ENA ?
Because you are filtering on the handle then (SETQ SOK (SSGET "P" LL)) WILL return nil ..
However, using DXF 8 for layer
(SETQ LL (LIST (ASSOC 8 (ENTGET ENA))))
(SETQ SOK (SSGET "P" LL))
you MAY get a match, if one of the menbers of SS is on the SAME layer as ENA.