There aren't any really good answers to be had. Documents containing media files are kinda bad news, because they're big. That imposes a penalty on simple things we often do with documents (such as making a copy before we start editing, to keep multiple versions around), and it's complicated working with big documents programmatically.
That's why many apps that manipulate lots of media either don't use the document metaphor, or use the document metaphor but keep the media files explicitly in some sort of library, which is more or less managed separately by the user.
NSFileWrapper has nothing to help you with undo, because it's for opening and saving, not for editing. A NSCache is probably not going to help, because you want data that's used by an undo action to keep its files. You don't want things getting deleted from the cache when they're still in use. (You can force things to stay in the cache for as long as you need them, but in effect you'd be managing the files manually, so the cache doesn't buy you anything.)
So, you're basically left with the temp directory strategy. One approach is to define a custom class that wraps a URL property that you use in your document and your undo chain to refer to files, instead of using URLs directly. You can implement "deinit" in the custom class to delete the file when the instance deallocates.
However, there's a problem that you don't really get control to clean up stranded files if your app crashes (or, for that matter, terminates, since it's not guaranteed that "deinit" methods are invoked when your app's process terminates). Temp folders do get cleaned up at reboot, usually, but it's probably not pro-active enough for your needs.
So, you don't really want to just put media files in an actual temp folder. One alternative is to use subfolders of your Application Support folder, since you can enumerate those at app launch and delete them. You would have one subfolder (with a unique name) for each open document, and you would normally delete it when the document closes. You would also need to copy files from this subfolder to the document during a save, if you want your undo chain to roll back over save boundaries.
This is all doable, but needs to be carefully programmed to get all the edge cases and race conditions handled.