Not quite sure but I got the impression the OP was talking about allowing the player to step on the tile from any direction but the player would then be forced to go back the direction they came from to get off of it.Just use 4-directional passage settings on the tile. You don't need a script for that.