I'm playing an online game and sometimes when i type autohotkey messes with my text.
How can i get it to ignore all my hotkeys when i press "enter" (which starts the chat) and turn back on when i press enter again?
You can use the Suspend command. Based on your example, the following should work:
~Enter::Suspend, Toggle
The above code is a delight. As a complement to gamers using this do allow for a Suspend toggle key
F12::Suspend
Its very helpful in case the suspend state might be in the wrong mode at the wrong time and also very useful if you do swap around windows frequently