a set of more or less unrelated meanings that have gathered around a suggestive sound: From 1806 as "to cheat, swindle" (slang); also dialectal duddle, diddle "to totter" (1630s); "move rapidly up and down or backward and forward" (1786). Meaning "waste time" is recorded from 1825. Meaning "to have sex with" is from 1879; that of "to masturbate" (especially of women) is from 1950s. Related: Diddled; diddler; diddling.
Entries linking to diddle
"artificial penis used for female gratification," 1590s, a word of unknown origin. Traditional guesses include a corruption of Italian deletto "delight" (from Latin dilectio, noun of action from diligere "to esteem highly, to love;" see diligence) or a corruption of English diddle. None of these seems very convincing (Florio's dictionary glosses many words with dildo, but diletto is not one of them.) Century Dictionary perhaps gets closer to the mark:
A term of obscure cant or slang origin, used in old ballads and plays as a mere refrain or nonsense-word; also used, from its vagueness, as a substitute for various obscene terms and in various obscene meanings. 
The earliest use of the word in this sense, and probably the start of its popularity, seems to be via Nashe:
"Curse Eunuke dilldo, senceless counterfet" ["Choise of Valentines or the Merie Ballad of Nash his Dildo," T. Nashe, c. 1593]
Other early forms include dildoides (1675), dildidoes (1607). Middle English had dillidoun (n.) "a darling, a pet" (mid-15c.), from Old Norse dilla "to lull" (hence dillindo "lullaby"). That sense probably survived into Elizabethan times, if it is the word in Jonson's "Cynthia's Revels":
Chorus: Good Mercury defend vs.
Phan.: From perfum'd Dogs, Monkeys, Sparrowes, Dildos, and Parachitos.
And dildin seems to be a term for "sweetheart" in a 1675 play:
Mir.: Here comes a lusty Wooer, my dildin, my darling.
Here comes a lusty Wooer Lady bright and shining.
The thing itself is older. A classical Latin word for one was fascinum (see fascinate). In later English sometimes a French word, godemiché, was used (1879). Also used in 18c. of things that resemble dildoes, e.g. dildo pear (1756), dildo cactus (1792).
Shakespeare plays on the double sense, sexual toy and ballad refrain, in "A Winter's Tale."
SERVANT: He hath songs for man or woman, of all sizes; no
milliner can so fit his customers with gloves: he
has the prettiest love-songs for maids; so without
bawdry, which is strange; with such delicate
burthens of dildos and fadings, 'jump her and thump
her;' and where some stretch-mouthed rascal would,
as it were, mean mischief and break a foul gap into
the matter, he makes the maid to answer 'Whoop, do me
no harm, good man;' puts him off, slights him, with
'Whoop, do me no harm, good man.'
"to shake, tremble," 1610s, perhaps a variant of dadder, from Middle English daderen "to quake, tremble" (mid-14c.) a frequentative formation on a pattern similar to totter, patter, etc. Wedgwood points to a large group of similar words signifying motion to and fro, including dither, diddle, dandle, toddle, doddle ("shake the head," 1650s). Related: Doddered; doddering.