The syntax is completely mangled here in order to allow the incredibly strict scheme of internal assonance and rhymes (which is really a tour de force). You have to untangle it before you can understand it. Mangling syntax so as to make your rhyme scheme work was out of fashion in poetry well before Tolkien's time, but Tolkien, one of whose academic specialties was mediaeval literature, didn't care.
Through Evernight he back was borne
on black and roaring waves that ran
o'er leagues unlit and foundered shores
that drowned before the Days began,
until he heard on strands of pearl
where ends the world the music long,
where ever-foaming billows roll
the yellow gold and jewels wan.
Assuming strands is a pun,
what it means is:
He was carried back through a night without end
on black waves that roared,
over miles of sunless, sunken shores
that drowned before day and night began,
until he heard long music sound
on beaches of pearls at the earth's rim
where billows foam, while tossing around
the yellow gold and pale gems.