I looked at your script, and it appears correct. However, I also noticed that you copied this straight from the guide (which is cool), but there are inherent problems with doing that. First of all, an entire line of commands needs to be on 1 line. For example, you have a line break (enter) after the "g" in gamecore, placing the rest of the line on the next line. You need to remove all unnecessary line breaks:
;Artificial Intelligence Script
;Header
desc = My Own HUD
;Triggers
:state=0:hudreset,hudx=50,hudy=90,hudimagefine=languagebank\english\gamecore\text\myownhud.tga,hudname=myownhud,hudhide=1,hudmake=display,state=1
:state=1,plrwithinzone=1:hudshow=myownhud,state=2
:state=2,plrwithinzone=0:hudunshow=myownhud,state=1
;End of Script
Basically, the engine sees a line break as the end of the current condition/set of commands, and attempts to start execution at the next line. If the engine does not see a colon at the beginning of a line, it will either skip that line or return an error in processing. You therefore need to remember to group your commands on one line. The best example of this is in the first line in the code I included herein. There are multiple commands being given after the "if" portion of the line, and these commands must be on one continuous line - the same line as the "if" portion.
Does that all make sense?