I think the problem is with the boolean logic ("and"/"or").  First, the isotropic:

optional (element H or element D or resname HOH or chain E or chain F or chain A or chain B)

This will be processed okay but it's going to select all atoms in chains A/B/E/F in addition to all H/D and waters, which probably isn't what you really want since the anisotropic selection includes chains A and B.  I'm not sure what will actually happen here, but it's better not to rely on the atom selections being processed in a particular order (and better not to rely on the code automatically handling the problem of overlapping selections).

chain A and chain B and not (element H or element D or resname HOH or chain E or chain F or chain A resseq 5:11 or chain A resseq 66:72 or chain A resseq 117:138 or chain A resseq 152:184 or chain A resseq 196:210 or chain A resseq 249:251 or chain B resseq 3:6 or chain B resseq 66:72 or chain B resseq 166:210 or chain B resseq 249:251)

The problem here is that you have specified that the atoms match "chain A and chain B", which is impossible.  You probably want this:

(chain A or chain B) and not (....)

-Nat