The classic remedy for pinworms (threadworms) was an infusion of quassia wood given as an enema. Potter's Materia Medica (8th ed., 1917) indicates "Quassia, gr. x in Oj aqua, as injections against the Oxyuris vermicularis (thread-worm)" - this translates as 10 grains (one grain being approx. 1/5 gram) in one pint of water). Squire's Companion to the British Pharmacopœia (17th ed., 1899) states "the infusion is also used as an anthelmintic enema in threadworm."
Squire's indicates the preparation is "Quassia wood, finely rasped, 88 grains; Distilled water, cold, 20 fl. oz. infuse in a covered vessel for 15 minutes; strain. =(about 1 in 100).
Quassia is described as "the wood of Picrasma excels, or of Quassia amara, trees of the nay. ord. Simarubaceæ. The former is known commercially as Jamaica quassia, and the latter as Surinam quassia... it contains a bitter principle, Quassin, C₃₁H₄₂O₉, which is crystalline, soluble in hot alcohol and in chloroform, slowly in cold water, faster in alkaline or acidulated water. ...Quassia is a simple bitter, having no flavor, but is intensely bitter and less agreeable than either gentian or chiretta. It is fatal to flies and fish, and makes an excellent anthelmintic enema against the thread-worm..." (Potter).
I remember having pinworms as a child in the early 1960s and remember the diagnostic procedure involving application of Scotch tape between the buttocks, but never got any sort of enemas as a remedy. I believe the medication used at the time was an oral one called Delvex. John Eichenlaub's book A Minnesota Doctor's Home Remedies for Common and Uncommon Ailments (1960) mentions this drug. Eichenlaub recommended enemas for lots of conditions (every enemist ought to read it!), but not for pinworms.