Please post the code you wrote when you had combined the two parts and discovered there was a problem. There's no real point us looking at fragments of code that aren't what you were running.
But you're definitely going to need to get rid of all those delays. A delay() tells the Arduino to sit there doing nothing at all until the delay has finished whereas what you want in that gap in activity is for it to go off and do another task, like monitoring the temperature.
State machines and timing using millis() are going to be the keys to your success.
Steve