Does the Applescript engine (?) get unstable with time?

I have a script I have been running daily since September that suddenly started to misbehave:

	tell application "Safari"
		set URL of document 1 to "about:blank"

The set-line suddenly starts to timeout!? I never restart Safari so the first thing I did was to quit Safari in case something was “unstable” there. Next time I start my script I launches both Safari and Firefox. Firefox isn’t at all mentioned in the script.

After a few cycles of quitting Safari and starting the script it suddenly works again.

I run this script from the command line because running it from Script Editor returns an error message on basic log lines (it doesn't understand the "log" message).

This “doesn’t understand the ‘log’ message” has happened before. A restart solved that. I assume that restarting also would solve the Safari timeout issue. The Firefox launch issue is just confusing.

The script perform as expected on my two other machines.

The machine I run this on has been on for 185 days and I suspect this uptime might be a problem. Does anyone else experience that AppleScript start behaving “oddly” on machines that has been on for a long period of time? Is there some process I can kill/restart to “reset” the AppleScript “engine”?

It’s unlikely that AppleScript gets exhausted over time.

It could be a timing issue. Your script presumes that there is at least one document when the script runs. But this is not guaranteed.
Try this more robust version of the script

tell application "Safari"
	if exists document 1 then
		set URL of document 1 to "about:blank"
	else
		make new document with properties {URL:"about:blank"}
	end if
end tell

I added your code but the problem remains.

execution error: Safari got an error: AppleEvent timed out. (-1712)

It is like Safari is locked by something?