You node does not return anything if previousTemp == temp or if neither of the two if statements is true. Therefore I deduce that one of those conditions is happening. You can use node.warn() statements to debug your code to find out what is happening. For example after the first section you can insert lines like
node.warn("temp is " + temp);
and that information will be displayed in the debug pane. Insert such statements at various points to see what is happening.
You should change to the current way of accessing the context, using context.get and context.set. At some point the old method may be removed.
Also I note that there are yellow triangles with exclamation marks against two lines suggesting syntax errors. I don't know what the code that you have will do as you have it, you should have the && on the line before.
What do you mean by 'keep running'? The code is run each time the Function node receives a message. Your code will send on a message under a couple of conditions you have in the code, other wise it doesn't return anything and the flow will stop.
about once a minute the Arduino refreshes the sensor data. so 1 time a min it re sends the updated temperature. The issue seems is that the function im using only shows a output on the first time of seeing data. After that i can change whats being sent to the node and nothing new or different comes out. Almost as if the code inside it runs 1 time and stops. I even tried using just a inject to test and had no change.
The reason nothing comes out is because it is getting to the end (where there is no return statement so it does not send a message) instead of one of the return msg statements.
As I said, put some warn statements in and see where the flow is going.
Have you corrected the errors in the code I pointed out that are highlighted with the yellow triangles?
I have just looked at the code and it will only send a message when the temperature crosses upwards over the upper threshold or downwards across the lower threshold. It looks as if this is the intention but perhaps not.