Wow, it’s really interesting and very old.
The first reference in the OED is from 1610: BABINGTON Comf. Notes, Gen. xxiv. 57 Such dilly dally is fitter for heathens that know not God, than for sober Christians.
The word dally is from Middle English dalien, from Old French dalier, but I can’t find a record of who was the first person to say “dilly-dally” and make up that phrase. Presumably it was already a saying when Babington wrote it down in 1610.