The post command might be killing the script before it has a chance to reset the resolution.
If you're starting the script when launching the game (and exiting the script when you press ESC), then you don't need IFWinActive.
Try this:
up::a
down::z
left::n
right::m
1::space ;Start Game
6::t ;Music On/Off
x::send DG {enter} ;For Highscore Entry
Escape::WinClose, ElectrEm ;Exit Electrem
cD = 32 ; bits (quality) - you can change to suit your requirments
sW = 1920 ; pixels - you can change to suit your requirments
sH = 1080 ; pixels - you can change to suit your requirments
rR = 60 ; Hz (frequency) - you can change to suit your requirments
ChangeDisplaySettings( cD, sW, sH, rR )
ExitAPP
Return
ChangeDisplaySettings( cD, sW, sH, rR ) {
VarSetCapacity(dM,156,0), NumPut(156,dM,36)
DllCall( "EnumDisplaySettingsA", UInt,0, UInt,-1, UInt,&dM ), NumPut(0x5c0000,dM,40)
NumPut(cD,dM,104), NumPut(sW,dM,108), NumPut(sH,dM,112), NumPut(rR,dM,120)
Return DllCall( "ChangeDisplaySettingsA", UInt,&dM, UInt,0 )
}
and leave the POST line empty.