AFAIK there is no way to close the application after a certain amount of idle time.
You can set the application to write a backup of the file every x minutes.
If the application is idle and the memory resources are needed for something else, the application will be paged to disk. The application will not use any meaningful resources.
I don't know of anything off the shelf that'll do that, but I suppose it's possible to script something. Closing (or killing) the application is easy enough, but it might take a little creativity for estimating/assuming idle time.
If I had to do it with the tools I currently have available to me, I could set up access to the document only through a terminal session (Citrix or TS) and then disconnect or log off the terminal session after a period of inactivity.