The quickest way is to create a new robot. It will come with the default AI code. Just copy and paste it off to a separate file, then copy-paste that into your old robot.
In addition, you might be interested in some of the many user-created AI scripts over on our Discord channel.