"two times, on two occasions, in two instances," late Old English twies, from Old English twiga, twigea "two times," from Proto-Germanic *twiyes (source also of Old Frisian twia, Old Saxon tuuio), from PIE *dwis-, adverbial form of root *dwo- "two." Spelling with -ce reflects the voiceless pronunciation.
Life is as tedious as a twice-told tale
Vexing the dull ear of a drowsy man.
["King John," III.iv.]
Think twice, then speak was an "old Prouerbe" by 1623. At twice, though less common than at once, means "at two distinct times; by two distinct operations."