Ideally this would be something that a reasonably skilled developer could finish in 30-60 minutes, that would demonstrate an understanding of, and comfort with, strictness, lexicals, modules, objects, and references.
30 to 60 minutes isn't much if you all want to test this.
It's also way too short to get familiar with the horrible
code you are describing. You also mention usage of strict
several times in your post. Don't stare yourself blind on
that. "use strict" is an aid, but a defensive one. Like
safety belts. You wouldn't judge the quality of a driver
on whether he wears safety belts or not (and while you may
demand that a driver wears a safety belt if you hire him,
his driving won't improve). You also might miss out on
great coders like Damian, who seldomly uses strict.
I once got to do a programming test while doing interviews.
A simple test: list all the files in the current directory,
or any subdirectories (no deeper than one level) that end
in '.foo'. Don't use the File::Find module. There's a white-board, here's a pen. Go ahead, write it, and explain what you are doing. Believe me, what I said
was far more important than what I wrote.
I'd say, if you make a test, keep the test simple. Don't
solely judge the result, look how the candidate reaches
the result. Let the candidate talk.