The word to be used that best completes the statement would be "had been having." The word is considered at a past perfect continuous state. This state of the verb should be used when indicating an action that was continuously done in the past. Simply and the progressive tense of the verb by "had been."
Squealer explain to them that pigs in milk and apples in order to think well and since the pigs work is brain work it is in everyone’s best interest for the pigs eat apples and drink milk