1) Create a new ability based off Entangling Roots
2) Set duration to 0 for units and heroes, make sure it doesn't show any unneeded graphics, or make the unit take damage, etc
3) Cast it on the unit by an enemy
The unit will be able to turn, but not move. You can make the unit move again, by removing the buff that the entangling roots ability gives it, but if you want to make the unit unmovable again, you have to recast it, obviously.