I'm having a similar problem, also on OS X 10.9.4, where a very simple script
tell application "iTunes"
return persistent ID of (first source where kind is library)
end tell
every now and then returns the exact same error message:
NSAppleScriptErrorBriefMessage = "Expected end of line but found property.";
NSAppleScriptErrorMessage = "Expected end of line but found property.";
NSAppleScriptErrorNumber = "-2741";
NSAppleScriptErrorRange = "NSRange: {45, 2}";
It's not a real solution, but in my experience a computer restart gets rid of the issue (for a while).
The whole problem looks like a bug in AppleScript to me.
Turns out I was running a Windows VM using Parallels at the same time. In the VM, there was also an iTunes instance. In essence, I had two different versions of iTunes on the same system. One that understands AppleScript and one that doesn't. Addressing the OS X iTunes like this solved the issue:
tell application "/Applications/iTunes.app"
return persistent ID of (first source where kind is library)
end tell
Perhaps the problem in the original question can be solved the same way.