If we assume the variable _trackID equals the track ID of the track you want to uncache, then you would do this:
<<set _tracks = Macro.get("cacheaudio").tracks>>
<<run alert('Error: Cannot uncache track "' + _trackID + '". Track currently queued for playing.')>>
<<run alert('Error: Track "' + _trackID + '" not found.')>>
That will display error popups if you attempt to delete a track that doesn't exist or a track that is currently queued for playing (currently playing or paused). You can swap out those "alert" lines for your own error handling method if you prefer.
Hope that helps! :-)
[Note: I haven't tested the above code, but I believe it should work.]