Enemies won't walk through environmental effects unless they are already affected by them (eg, already on fire, will walk through fire). Using that knowledge to your advantage isn't abusing a bug it is intentional.
The bug though is that when an enemy has no way to attack any of your party without entering such a surface, they do not immediately PASS the turn but instead sit there idle for 15 or so seconds while you wait for them.