It's better if you declare your new functions under your main function.
Code:
random code
#include <.... .au3>
.........
main function()
.........
random function_1()
.........
random function_2()
.........
The main function is the most important thing in your script. So it's easier to find and your script will be clearer.
But back to your problem.
Code:
HotKeySet ("^x", "_iFunction")
Global $iStatus = True
While True
if $iStatus == True Then
MsgBox(64, "iFunction", "Function is enabled!" & @LF & "Press CTRL + X to disable this function.")
EndIf
WEnd
Func _iFunction()
if $iStatus == False Then
$iStatus = True
ElseIf $iStatus == True Then
$iStatus = False
EndIf
EndFunc