For "embedded" you mean sites loaded as IFrames, such as youtube videos when they are loaded inside another page?
If so, you can compare if the window where the script is loaded is non the top window:
if (window.top == window.self)
return;
In this case, the script will be loaded both in main windows or in iframes, but it will actually run only if it's loaded in the top window.
Just a request for info: I'ld hoping for a regex that can be added as a User-Exclude for certain scripts so that they do not trigger when an embedded object is found.
I'm currently using the one pointed in https://greasyfork.org/forum/discussion/71798/small-bug-with-embedded, but most sites nowadays are developed to avoid falling for such an easy filtering trap.
I wonder if a regex can be used, rather than manually modifying the scripts.