For context I play 3.5e Dnd, and my character has an amulet of Protection from Evil (continuous effect magic item) and an Evil Dragon successfully cast Programmed Amnesia on him despite the second effect of the protection from evil.
Would the second effect of the Protection from Evil (bold text) prevent the effects of a Programmed Amnesia spell (italic text)?
Second, the barrier blocks any attempt to possess the warded creature (by a magic jar attack, for example) or to exercise mental control over the creature (including enchantment (charm) effects and enchantment (compulsion) effects that grant the caster ongoing control over the subject, such as dominate person). The protection does not prevent such effects from targeting the protected creature, but it suppresses the effect for the duration of the protection from evil effect. If the protection from evil effect ends before the effect granting mental control does, the would-be controller would then be able to mentally command the controlled creature. Likewise, the barrier keeps out a possessing life force but does not expel one if it is in place before the spell is cast. This second effect works regardless of alignment.
Programmed Amnesia (Spell Compendium, p.162)
Enchantment (Compulsion) [Mind-Affecting]
Level: Sorcerer 9, Wizard 9,
Components: V, S, M,
Casting Time: 10 minutes
Range: Close (25ft.+ 5ft./2 levels)
Target: One living creature
Duration: Permanent
Saving Throw: Will negates
Spell Resistance: Yes