1. How the "weight" variable is actually computed?
So - there is a # in each block and a math op is performed with this # + the account # of the "forger" to provide a new #. You can just think of that # as being the "best account #" so the account who's # is closest to the "best" would be the "best choice" to forge the next block (so would have the max. "weight").
If that account doesn't forge then an account "near" it can forge it instead (how near is increased over time to ensure that a block should always appear every minute). So "later forgers" have less weight (the exact weight being determined by their account #).
2. In particular, for what reason the weights on a "bad" branch are supposed to be much smaller than on the main one?
An unsuccessful branch (or fork) just has "less weight" than the "main chain" so basically it would likely have been forged by nodes that actually can't see the whole network (perhaps due to IP blocking or the like).
3. Assume that a node sees at least one neighbor with a different version of the blockchain (from the blockchain that our node has). How does it decide, which is the "correct" one?
The "correct" one is simply that with the most weight - so at any point a node could ask another node for the "height and weight" of their blockchain and if that answer is better than their own then they would ask for those blocks in order to "switch chains".
Then, do I understand correctly, that the main object of interest is the probability distribution of the length of the "bad" branch? That is, we should be able to issue statements like "given that the bad guy has X% of all NXT, he can grow a bad branch of length at least 10 with probability at most 0.00000000003", right?
Exactly - we need those figures.
On the side note, there is probably also a question about penalizing "suspicious" accounts. Because if the rules are too strict, then inevitably your would penalize some good guys too, and so maybe an attacker can invent a strategy to break the network because too many nodes are penalized. Is this a possible issue?
The whole penalty thing is something we are trying to figure out as it will inevitably penalise nodes that are not malicious and may "turn people off" helping the network by forging.
Once we have the math we can make a much better decision.