You have to set the hold music to play for a specific duration, and then build a menu prompting the caller whether they want to continue to hold or transfer to voicemail.
You can transfer to a user's voicemail (there is no option to transfer to voicemail for an ACD queue, since there is no such thing as a mailbox associated with a queue).