I'm a huge nerd
Legolas isn't in The Hobbit, but his dad, the King of Mirkwood, is. So it's really not much of a stretch to stick him in there for a brief cameo. Just have him wink at the camera and give the ladies a case of the vapors, that sort of thing.