Mac Mail "Not Responding" with Gmail IMAP account
Do you have a Google "App password" set up?  If not, you need one.  This thread has a lot of information about how to do that: How to setup Gmail SMTP server for OSX Mail with 2-step-verification and App-specific password?

If that is not the problem, it may be that the Yosemite upgrade broke it.  I posted a detailed list on the apple forum of steps I took to fix a similar problem.  Although I am not using two-step verification, some of these steps might help you, because there seems to be some significant issues with Yosemite upgrades "breaking" Mac Mail.  I didn't use detailed instructions regarding navigating to all the settings; if you need assistance with that, reply here, and I'll elaborate: https://discussions.apple.com/message/28551720?tstart=0#28551720