Welcome aboard ... to get that motor out you need something cold to drink, some good music, a contortionist and a masseuse
I'm not 100% sure on the flange type motors, but there is another through bolt (perhaps two) on the end of the motor. I've always thought those two flange bolts pulled 'em off. BUT they may actually go all the way through and connect with the intermediate housing. Try removing it/them.
You don't need to do anything with the worm gear ... just remove the motor by itself. However, if you do need to remove those through bolts that whole assembly is going to want to come apart on you. So be careful. There is also a spring, and a hammer coupling inside the intermediate that'll want to jump out and go hide in your bilge. You don't want to lose 'em ... so again, be alert.