What is meant by "offence can scarcely be visited on the quantity"

M-W records visit on/upon as a phrasal verb:

formal + old-fashioned
: to punish (someone) with (something)

  • The Lord visited a plague upon the city.

The author receives the advice not to be tedious by expressing things in too many boring words - life is short. He did follow the advice, so the sentence:

The offence can scarcely be visited on the quantity.

means that although what the author has written may be wearisome, it is not because of quantity (of words). The offence of being tedious cannot be inflicted on the quantity of words he used, but rather on the content of the words or on something else.

FreeDictionary defines the phrase as meaning:

To inflict something punishing or burdensome on someone or something. Used chiefly in the passive:

  • A plague was visited on the village.