There are others who will give more complete answers with lots of lovely blue clickies (links) to specific examples and sundry references, but here's a start.
It looks to me like the author was thinking of some version of Child Ballad #1, "Riddles Wisely Expounded," wherein the devil (possibly in disguise) or a lover quizzes one or more persons (and sometimes they quiz each other) with riddles such as "what is taller than a tree? What is wider than the sea?" having answers like "Heaven is higher than a tree. Hell is deeper than the sea." The reward for answering correctly is either escaping the devil or getting the knight. In 3 sisters versions, the eldest and middle sisters don't know the answers, but the youngest answers correctly and wins the handsome knight. The American Appalachian song "I Gave My Love a Cherry" is a fragment of this ballad group, with the riddles and answers, but without the introduction and conclusion about who's asking and who's answering.
Some of these songs have refrains with floral or herbal references, like the familiar "parsley, sage, rosemary and thyme" (Although the "Scarborough Fair" you know this from is in a different song family -- the elfin knight or lover asks not riddles but for impossible tasks). Flowers and herbs often have (or used to have) various symbolic meanings. As the songs migrated, sometimes local flora got substituted for the symbolic flora, so there's a lot of variation. "Juniper, Gentian and Rosemary" sure sounds like it fits in there.
In the Ballad Index, here's the start: http://www.csufresno.edu/folklore/ballads/C001.html
~ Becky in Tucson