The sound device used to create a musical effect in the lines “Five miles meandering with a mazy motion" is “consonance”.
Step-by-step explanation:
Consonance is the repetitive sounds of consonants in a given line, which may or may not be placed in succession with each other.
Alliteration are the age old tongue twisters which have same consonants sounds in the beginning of almost each words.
Assonance is where the vowel sounds get repeated in the concerned line, which makes it more rhythmic.
Onomatopoeia is where the sound of the word is the same as the actual happening of the action, such as “slam, puff’ etc.”
Hence regarding the above, consonance becomes the most appropriate sound device for the lines given.