You're plant is healthy, but growing long and lanky because of low light levels, and still air. Plants that grow in windy areas will have a sturdier build as the same species grown in still air. I would head it back, similarly to what is shown below (marked in red). Cut the stem about 1/4 inch away from a healthy leaf/bud. That's where the plant will regrow from.
Avocados are large plants and containing them like that forever is not healthy. For now, though, it should be beneficial as it will encourage the trunk to grow in diameter as new top growth is produced. I would cut it back in mid to late spring, so the new growth can get the most sunlight possible.