Resume what Google display was doing before I interrupted it

I found a script which handles this. It works great, I highly suggest it for anyone having the same issue. Script to resume Google Cast devices after they have been interrupted by any action