Blizzard made the AI Editor public for this purpose (available in WE). The editor AI files are called ".wai" and compiled into Jass they become ".ai". I think some of the "custom blizzard maps" have .wai, if you are looking for examples. Otherwise there are many .ai scripts from campaign including melee races, but those are quite complex.