I am not quite familiar with the batch format but if you try this batch:

FOR %%A IN (testline) DO (
FOR %%B IN (testline2) DO (
)
IF condition==condition DO (
something
) ELSE DO (
something
)
)

everything looks OK and Notepad++ doesn’t have any problems recognizing the parenthesis.
I think that the ‘Do’ in your syntax is recognized as a keyword and also the IF and ELSE appear to need corresponding DO keyword.