Pill boxes in a military sense, were certainly around in the First World War (1914-1918) and the Germans used them all across the Western Front as a defensive position. However, I am pretty sure that they were not a new invention then. Try spartacus.schoolnet.co.uk/FWW for info on World War One and follow any links. Hope this helps
if you mean a little container for storing pills, i doubt they were ''invented'' at all, as such.
they are just a small container or tin that people would have ''acquired'' to store their pills in, and eventually companies began to manufacture them specifically for that purpose.
i say not invented because there are many things that could be a pill box - camera film containers, snuff boxes, cigarette tins, ring box etc