Just to add to this, in long sentences like this one it’s the particles that are the key to understanding how each part of the sentence relates to the others and extract the meaning of the sentence. In this case 。。。ことだった is completing the thought of 。。。は.
気が変になる means to go crazy or to lose one’s mind. So she’s saying “If I said something like that, people would think I’ve gone crazy from studying!”
Past tense for なった because people would think she has gone crazy.
思われる is the passive form of 思う and it’s used because we’re talking about this from Kazuko’s point of view so saying she’d be seen as crazy is more appropriate than making her classmates the subject of the sentence.
ちゃう is the casual form of the ~てしまう grammar point. This can be used to refer to completed actions, but more often it’s used for unintentional actions, usually with an undesirable result. So Kazuko is worried she would end up being thought of as crazy if she said such things (which is not her intention and is also an undesirable result).
The weird way being that Mariko thinks Kazuko has a crush on Gorou.
Not very harsh as far as I’m aware. Keep in mind that the majority of Japanese insults are not harsh by definition, but they can be in context. For example, お前 just means “you”, and is totally fine for me to say to my close friend, but if I say it to my boss I’m being incredibly rude.
いやな itself just means unpleasant but I think it can be strong or harsh depending on the context (not 100% sure on this though so take it with a grain of salt). Kind of like how I can say “Ugh I hate X” in English and it can mean I don’t really mind X but I’m being dramatic, I kind of dislike X, or I despise X and you would understand which one I was going for based on the conversation we were having.
Btw, she actually says いやな神谷さん (referring to Mariko by her last name).
Actually it’s 気をつければ and りゃ is a casual contraction of れば. So literally he’s saying “As long as I’m careful, it’s fine right?” which essentially translates to what @Myria and @Abstormal were saying.