Ignition 8.1 Perspective UDT Expression Tag Bad_ReadOnly

I have a expression tag running a switch function monitoring the state.value of a tag.

switch(
{[.]OEE_PackML_Condition/State.value},
"Held", "Holding", "Unholding", "Idle", "Resetting", "Complete", "Stopping", "Clearing", "Stopped",
1,1,1,1,1,1,1,1,1 ,0)

I have multiple states that im counting towards a single Time in another expression tag.

if({[.]idle},if(IsGood({[.]idle_time.value}),{[.]idle_time.value},0)+1,if(IsGood({[.]idle_time.value}),{[.]idle_time.value},0))

Pretty much if the state switch to any of the cases it will return a 1 else 0 . This works but seams laggy and i found that its possibly do to 10k errors being written to the log every 5 sec LMAO. If anyone has a solution

ERROR :

Error writing tags Error writing to tag '[default]SMARTPACs/SMARTPAC 1/idle': Bad_ReadOnly("Tag value source does not support writing.")

I was able to find a out the problem. I had created scripts to try and stream like the data being pulled . I had deleted them but they was still running in the gateway !! Not sure how as they was deleted 2 days ago but I canceled them in the Currently Running Scripts section and no more errors .