My translation:
I had a headache at work today. Later on I took a nap but it still wouldn't go away, and when I looked into it, it seems that migraine headaches get worse if your body temperature is too high, so I turned off the heater, let in some fresh air, and had a cup of coffee. After that I felt a little better.
All three of the と's have the same basic meaning, that of "upon doing something." You'll notice that I translated (1) as "when," (2) as "if," and (3) with no direct translation at all.
What is the subject of the clause "片頭痛は身体を温めすぎると頭痛が増すようで" ?
片頭痛 is the topic, and 頭痛 is the subject of the verb 増す.