how to add .js programatically when in an entity list I'm in the hook_entity_load in my module and I want to dynamically add a .js library which I already have defined.
The thing is i need to get to  the block objec I'm on to add the library using $block['#attached']['library'][]

How do I get this block object?
The correct approach is doing it using a custom list builder, assuming you are using that and not a view.

class MyListBuilder extends EntityListBuilder {

  public function render() {
    $build = parent::render();
    $build['#attached']['library'][] = 'yourmodule/library';
  }
}


Then specify it in the annotation of your entity type.see Node/User or so on how to do that, most entity types specify either the default or a custom list builder.

If it's a view then you can implement one of the many views hooks, if it's not your own entity type then I'm not exactly sure why you need to add a JS there and you should explain in more detail what kind of list it is and what your JS does.