(1) Try to find a tree:
(2) - If you fail to find a tree:
(3) - - Goto 1
Plus you have a bunch of stuff that appears to indicate that you don't understand how the mob AI works, like your CreateNetherPortal method which tells the entity to find 14 lava blocks in one tick. It doesn't wait for the entity to actually DO anything, it says "find a lava blocks, place lava block, repeat 13 more times." All in the same function.