In BG2:EE update 1.3 sleep and unconsciousness inflicting effects were changed so that if a creature suffering from these effects were damaged they would wake up and the effect would wear off. At the moment all sleep inflicting items and spells (erroneously) do this, but the developers intend to refine this behavior a bit so that only specific spells and items inflict a sleep effect that can be broken by damage while others will inflict an unconsciousness that is not broken by damage.
The effect of this mod is to make all sleep and unconsciousness effects inflicted by items and spells last until their duration runs out. In other words this mod prevents creatures from waking up if they take damage while asleep. Since the developers also plan to eventually bring this behavior to BG1:EE, this mod will work on both BG1:EE (for when that gets updated) and BG2:EE, although it will need to be installed on each separately.
To install simply extract the all the contents of the zipped folder into your Baldur's Gate I: Enhanced Edition or Baldur's Gate II: Enhanced Edition directory (inside the folder with the baldur.exe) and run the "setup-UnconsciousRestore" file and follow the on screen instructions.