You get into the 'friend zone' by, well, being her friend....
Getting too comfortable with a girl, showering her with attention and treating her with TOO MUCH respect does it.
Whenever I feel it's moving in that direction, I distance myself. Intentionally ignore her, act...