I'm not an adcom, but as a non-trad student I see no downside to taking gap years.
Taking the time to get your dosages under control (please go see your provider about this, it's not a trivial issue) and to do other things that you think are important are well worth the time away from school.
Yes, applications will ask what you did in your time away from classes. But so long as you were actually doing something, this isn't an issue and can even be a positive (it shows good judgement to step away when you're overwhelmed and fix things before going back into the fray). You mentioned doing volunteering and research- either or both would be a good use of your time and would allow you more flexibility to deal with your personal issues than the constant rush of classes.
Best of luck to you.