Following the question Must 5e elves take a long rest? and LegendaryDude's suggestion, I wanted to further elaborate on the benefits elvish trance has while adventuring.
In the PHB 5e, there's a note that says:
Elves don't need to sleep. Instead, they meditate deeply, remaining semiconscious, for 4 hours a day (The Common word for such meditation is "trance."). While meditating, you can dream after a fashion; such dreams are actually mental exercises that have become reflexive through years of practice. After resting in this way, you gain the same benefit that a human does from 8 hours of sleep.
To further clarify, meditation is defined as:
think deeply or focus one's mind for a period of time, in silence or with the aid of chanting, for religious or spiritual purposes or as a method of relaxation.
Combining those two definitions, I'm understanding that elves take 4 hours out of their day to block out the world around them, focusing intensely on either something or nothing... Either maintaining an unwavering concentration on one topic or allowing stray thoughts to pass through them, giving them dreams.
If this understanding is accurate, would that suggest that while in a trance, an elf can maintain a spell that requires their concentration to keep up?
Your party takes heed to their position. After a long and perilous journey, the cult leader is just beyond the doors, yet your party is down to half strength, at best, and exhausted. Having overheard a guard mention that the leader was not to be disturbed for the next eight hours, you decide it's best to take the cautionary path and rest for at least 4 of those hours, allowing everyone to recharge and prepare for what you expect is going to be a tough fight.
As a measure of precaution, your party takes up base in a small corridor, sealing one side with the spell mold earth while your elven wizard casts an illusionary spell on the other to hide your presence.
Note: In this situation, the idea is that the spell can be maintained while the elf uses trance to gain full benefits as if rested for 8 hours.