Old School Essentials Mechanics
Duration: 6 turns
Objects enchanted for evil purposes or living beings with evil intentions are caused to magically glow.
-Intent only: it does not grant the caster the ability to read minds
-Referee must decide what is 'evil'.
Here is the original found on Page 24 of Men and Magic in ODnD
Detect Evil: A spell to detect evil thought or intent in any creature or evilly enchanted object. Note that poison, for example, is neither good nor evil.
Duration:2 turns. Range: 6”.
I am also familiar with Sense Foes from GURPS Magic that Tim refers too.
My own take emphasize the danger sense aspect of the spells. While it is something I prefer it is also in part necessitated by the fact I haven't used alignment in decades and still don't.
I have two added wrinkles that in the case of magic it also senses when somebody been affected by magic against their will. For example a character under influence of a Charm Person spell. This type of magic is considered a hostile enchantment. It also detect demons and anything demonic. In my campaigns demons represents absolute evil in a spiritual sense.
Here the current write up for Detect Evil from my draft rules for the Majestic Fantasy RPG
Detect Evil (Cleric, 1st Level;)
Range: 120 feet; Duration: 1 hour; MI: No; Art: Lantern;
Detect Evil (Magic-User, 2nd Level)
Range: 60 feet; Duration: 20 minutes; Art: Lantern;
The caster detects the following dangers for the duration of the spell: hostile sentient beings, hostile monsters, and enchantments/auras that causes damage or some type of harm. It does not detect traps, poisons, and other mundane dangers. Demonic and demonic effects are always considered hostile.
Focused Art: For clerics the spell’s range is extended to 180 feet and the duration for 2 hours. For magic users the range is extended to 90 feet, and the duration to 40 minutes.
I have some additional mechanics in my take on Swords and Wizardry. MI is magical immunity. It determines whether is creature with magical immunity is effected by the spell. Since Detect Evil pertains to the caster it doesn't apply.
Focused Art is an option in my rules where a magic user can focus on one of the ten arts of magic. If they do they get a small bonus effect to spells of that art. An aspect of the Art of the Lantern that it covers spells that impart knowledge of some kind. For clerics it depends whether the art of magic falls into the deity's sphere of influence. In the Majestic Fantasy Realms this would be Thoth the Lantern Bearer the God of Sages and Knowledge.
Originally a focus in the art of magic would meant +1 caster level for that spell. But in Swords and Wizardry so few spells are affected by caster level that I had to come up a customized focus effect for each spell.