The posted script can't be compiled. I highlight several oddities
==========================================
if wakeup_tune is missing value then
display dialog "Select an alarm tune"
end if
repeat
set wakeup time to display dialog "Enter wake up time" & return & return & "Formats accepted as below" & return return & "mmicidtyy hours:minutes' & return & "hours:minutes AM/PM (if current day)" & return & "June 25 hours:minutes AM/PM (if current year)" default answer wakeup_date buttons "{Cancel", "Continue"} default button "Continue"
set requested_date to text returned of wakeup_time
try
set wakeupDate to date requested_date
exit repeat
on error
display dialog "Invalid date format. Enter date as set up in your System Preferences"
try
on error number -128
return
end try
end try
end repeat
repeat
set wakeup_tune to choose file with prompt "SELECT AUDIO FILE FOR WAKE UP TUNE" of type {"public.audio"} default location alias "Macintosh HD:Users:user_name:Music"
set wakeup_tune to wakeup_tune as text
tell application 'Finder" to set song_name to name of file wakeup_tune
display dialog "You selected" & space & quote & song_name & quote & " for alarm." buttons ("Select another", "OK") default button "OK"
if button returned of result is "OK" then exit repeat
end repeat
set message_dialog to display dialog "You will be woken up at' & space & wakeupDate & return & "You will be woken up with" & space & quote & song_name & quote & "." buttons ("Cancel", "OK") default button "OK'
If button returned of message_dialog is "Cancel" then return
#date formatting for the shell command that overrides Sleep Mode for use in localized systems with non-US date formatting. If the US date formatting is your native you probably won't need assembling Unix_long_date variable as in this script.
set locale_Date to date requested_date
set short_date to short date string of result
set time string to time string of locale_Date
set Unix_day to text 1 thru 2 of short_date
set Unix_month to text 4 thru 5 of short_date
set Unix_year to text 7 thru 8 of short_date
set Unix_short_Date to Unix_month & "/" & Unix_day & "/" & Unix_year
set localeDateAdjusted to locale_Date - 0,5 * minutes
set timeStringAdjusted to time string of localeDateAdjusted
set Unix_long_date to Unix_short_date & space & (timeStringAdjusted as text)
do shell script "sudo pmset schedule wake" & quote & Unix_Iong_date & quote password my_password with administrator privileges
repeat until (current date) ≥ wakeupDate
delay 10
end repeat
tell application id "com.apple.QuickTimePlayerX"
activate
open file wakeup_tune
tell document named song_name
set track_time to (get duration)
play
end tell
delay track_time
quit
end tell
set wakeup_tune to missing value
===========================================================