The author was using "literally" chiefly according to its play-on-words definition of the samples having been drawn from literature.
As for the claim that "literally" ever means "figuratively", I have never encountered that use - including in examples offered by those who claim its existence. Literally is sometimes used in figurative circumstance, but I would argue the use is hyperbolic - in the same way we don't say "'days' sometimes means 'minutes'" because people say "I've been waiting for you for days". I have never seen an example that would not have been understood to be figurative but for the addition of "literally".
I love it!