These are both very big. Even if your research is in a different area from where you end up, it is still quite valuable to have the experience on your resume when you go looking for a first job.
This may depend upon what university you are at, and my understanding is that you are at a university that I am not familiar with. However, in my experience as students get older they party less and study more. This is likely to get better over time. Some of this might be due to the heavy drinkers flunking out and leaving. Some might be due to their getting bad grades and realizing that they need to try harder. Some might be due to them getting tired of waking up hung over.
Also, the quiet and studious students who are more “like you” might be more difficult to find than the loud students, but they are there regardless of which university you are attending. Some might want to share an apartment near campus.
It is very hard to know. However, I would be tempted to stick it out where you are.
And yes, your in-state flagship might not be any better in terms of the drinking and partying.