Once you have the data from the heating process, fit a curve through it. Do the same thing with the cool-down data. You then have an approximate expression for the evolution of the temperature with time when the heat source is on and when it is off. You should in general get a shape like $T(t) = T_0 + f(t)$ when the oven is on and $T(t) = T_0 - g(t)$ when it is off. Use these expressions in your code. Everytime the oven is switched between on or off, you switch equations in your code.
More in detail: if you start at $t=0$ with $T(0) = T_0$ and the heat source activated, you do nothing until an action is taken. Keep a logical variable
active with value 1 if the heat source is active and 0 if not. If the action is to switch off the heat source, you simply change the value of your logical variable, overwrite $T_0$ and put $t=0$ again. If the action is to measure the temperature, read the logical variable and calculate the approximate temperature $T(t)$ using the expression corresponding to the value of
active. You know $T_0$ and the time $t_1$ passed since $t=0$ so it's a straightforward calculation. (you know the time either from the actual time passed or from a simulated time that you could establish yourself)
If desired you could put all this in a loop and calculate the temperature nearly continuously while the heat source is being activated and deactivated. But my answer is already getting into the field of programming more than physics.
The precision of this particular approach depends partly on the accuracy of the plots (if the data is good). If the fit is no good, any extrapolations made with it will be completely unreliable. But if your heat source isn't too whimsical, you should be able to get a more than reasonable fit with a fairly basic mathematical model.
Another aspect of the problem which could have an important impact on the reliability of this approach is if the system exhibits a significant amount of hysteresis or if there is a time-memory. Both phenomena would be difficult to incorporate into a general model, at least without additional experimental data of different heat-up/cool-down cycles. So if their effects are not negligible within the desired level of precision, you will need more knowledge of their behaviour through experiments.