Why do you need a script to mark a file as watched? On Plex and XMBC you can easily toggle a file's watched/unwatched status from the navigation interface.
I store this watched status on a server that other people created. It is used to collect statistics of how many people watched a particular file. It also allows me to see what files I've already watched as I use multiple devices.
There is a mymediadb plugin for xbmc that does this. Can probably borrow code from there if you have your own backend thingy. https://github.com/netbrain/mmdb-xbmc-addon
You can run queries against XBMC sqlite database or use http://trakt.tv/ to keep all your XBMC in sync.
Has anyone come across a way of doing file-level 'actions' within a full screen media player?