Yes, something like that. If block and it's content are loaded in the page (so I guess detect by ID or something) it would load the .js, but if block is not loaded, it wouldn't load the .js.
I need this, because now each time when the block is not loaded, it still always loads the .js from theme in every page no matter what and that code interacts for some reason with other javascript elements like flexslider and it disables it for some reason and etc. Which is bad.
So it should load the .js only when the block is rendered/printed.