One problem can be that you type something like $PLAYER when you should type $PLAYER0, or whatever it may be. This can cause text to fail to display.
If you enter precisely the number of lines that the original had, it ought to work. I don't know why you're entering different numbers of lines. If you want to do this, you have to fiddle with the numbers that come at the start of each section. For reference, this is how they work:
civ - if this is a 1, then the strings will be civ-specific. If it's a 0, they will not.
power - if this is a 1, then the strings will vary according to the ai's power relative to the player. If it's a 0, they will not.
mood - if this is a 1, then the strings will vary according to the ai's mood towards the player. If it's a 0, they will not.
random - this gives the number of strings in each sub-category.
So, say you've got civ=1 and the rest are 0. This means that there will be one string for each civ in the game. An example is the "first contact" string that comes at the start of the file.
Say, though, that you've got power=1 and the rest are 0. This means there will be precisely three strings, because the AI can be weaker than you, the same strength, or stronger. So in the first text, the AI should be speaking as though it is weak, and in the third as if it is strong.
Again, if mood is the only one to have a 1, there will be only three strings. The first will be friendly, the second neutral, and the third angry.
Finally, if the random variable is the only one to have a 1, this is simply the number of strings there are, and it could choose any one of them at random.
It gets complicated when things are combined. Say that civ=1 and mood=1, but the others are 0. This means that for each civ there will be three strings, each corresponding to a mood. So first you will have three strings for the first civ, then three for the second, and so on. The same would apply if it's civ=1 and power=1 - each civ would have three strings, each one corresponding to a mood. If you have civ=1 and power=1 *and* mood=1, then you have nine strings for every civ. The mood ones will be "nested" within the power ones, which in turn are "nested" within the civ ones.
The random number multiplies everything else. Say that you have civ=1 and random=3, but the others are 0. This means that you will have three strings for civ 1, then three strings for civ 2, and so on. But the game will select one of the three at random, not according to power or mood. An example is the "peace greetings" section - when you meet with an AI that you already know, it may say one of three strings, at random. Again, imagine that you have civ=1, mood=1, and random=2. Now each civ will have six strings - two friendly ones, two neutral ones, and two angry ones.
Hope all that helps! Basically, if you get anything wrong, the results are unpredictable. For example, if you don't provide all the strings that you have specified, the result is likely to be just a blank string being returned (ie, the AI appears to say nothing). However, problems with one section shouldn't affect another. For example, if you screw up the "peace greetings" section, I don't think this should have ramifications elsewhere, because each section is headed by the codes that tell the program where it begins.