After having visited the L4 leading Trojans ("Greeks") of Jupiter, almost a decade after launch Lucy will spend almost 4½ years moving on to the trailing L5 Trojans, 5 AU away. Is there a special window of opportunity of trajectories that motivates this huge traverse across the inner Solar system in order to fly by another asteroid?
To get from Earth orbit to Jovian orbit takes a lot of energy - You need to turn your nearly circular orbit round Earth into a Hohmann transfer orbit (an ellipse with the other end out by Jupiter's orbit) and then once you are there you need to reduce the elliptical extremes by expending more energy to move your orbit to match Jupiter. If you then wanted to come back in towards the sun you need to expend yet more energy to move the ellipse once more. These changes are your delta-v budget.
However in this case Lucy is not in a Jovian orbit. It is in a highly elliptical orbit, as @Hobbes pointed out, and one end of that ellipse is already within Earth's orbit. So it doesn't require any further delta-v to come back in towards the Sun and out again. All that is required is a much smaller energy cost to aim the outermost end to be at L5 rather than L4.