Thinking during Vipassana meditation Please correct me if I'm wrong. 

From what I read, the purpose of Vipassana meditation is to get insight, and wisdom about one self, in order to achieve a better life and eventually nibanna. 

The way I have been taught to practice Vipassana, is to focus on the present moment, feeling the sensations or emotions as they appear and disappear, observe the changes in the mind, and so on. 

However, in order to get insight, am I not supposed to analyse what is going on, looking for answers ? In order to think in that way, isnt'it necessary to break the focus on the present moment and therefore break the meditation ? 
Maybe it is part of the meditation ?

As an example, suppose that I am meditating. Suddently a feeling of anxiety arises. I turn my focus to this feeling, gathering informations, feeling it for what it is, seeing the impermanence in it, etc. Then the anxiety disappears or some other thing arises, so I need to switch my focus in order to stay in the present moment.

Instead, I would like to investigate this feeling, trying to guess why it happened, seeing if there is a way I can prevent myself from feeling it again, or if there is a way to prevent myself from the suffering I create by repeling this feeling. 

Experience as shown that I can get to great insight by interrupting the focus on the present moment to investigate the feeling. However on some other occasions it distracted me. In addition I imagine that the insights I get may be sometimes incomplete or false views ?

How I am supposed to go about this ?
All in all, the boundaries between thinking and not thinking are more conventional than real. The brain is a machine that is always at work doing its thing, whether we create narratives like "I'm thinking", "I'm meditating" or not. It's a machine that can see patterns and connections between the things it sees -- so as you keep looking, seeing happens (semi-)automatically. As long as you look with clear attention, that is. Learning some dharma theory does help with seeing things in the right perspective, but it sounds like you already have that. So in some sense it doesn't really matter what you do - as long as you keep looking with right attention your mind will almost "enlighten itself".

Anything you do is fine, there are no hard rules. You can interleave analytical meditation and introspection if you want. You can read a paragraph of a book, put it down, think about it. Or you can watch your mind in parallel with reading a book. As you become more advanced all boundaries between different types of meditation begin to melt and look obviously contrived. As my Zen master used to say, regular thinking is not different from meditation. Regular mind is not different from the Diamond Samadhi.

However, there is virtue in formal meditation that is pure introspection. In this approach we don't discursively reason about things we see. We engage attention in looking inside and let the pattern-seeing machine of our brain do it's work connecting the dots on autopilot. Makes sense? So you just look and stare at that emotion, trying to go deeper into it, and then boom, you see it's root in some sort of childhood event, that created a preconception that now manifests as attachment. You don't "calculate" this insight analytically, it happens by itself through deep looking.

Similarly, there are other, deeper, types of insights that are only accessible through this sort of intuitive staring, informed by dharma theory. For example, you can stare at your mindstream and then suddenly realize you now know what they meant by suffering and attachment. Or what they meant when they said everything is empty. The bottom line is that meditation is not entirely non-analytical, but it's not your regular thinking either.