All you need is a Sorcerer or a Troglodyte in your party (who knows
spells up to Level 3) and you can simply cast Cure Daze or Cure
Insanity respectively. This works at any time, even during battles. If
your insane character carries Enchanted Berries, you can have him/her
eat it, which cures the insanity, but not during battle. (If another
character has the Berries, you're out of luck, you can't give anything
to an insane character.) Sorcerers and Troglodytes can cast Cure
Insanity spells on themselves (but once again not during battle).