Yikes! What a mess.
the short answer is, yes, you might be able to back engineer the gear from the worm.
First, the missing gear is most likely to be a worm gear, not a spur or helical gear.
The general procedure will be:
1. measure the pitch of the worm. That is, the distance from tooth to tooth, just like measuring a thread. If possible, lay two gage pins in two adjacent tooth spaces (such that they tough the worm teeth at approximately the pitch line) and measure the center distance between the pins. If that's not possible, then measure whatever you can and you will be close.
2. From the worm pitch, calculate the diametral pitch of a mating spur gear. The DP is related to the tooth pitch. It will most likely be a standard DP, whether imperial or metric, so if you are off by a little bit, round to the standard DP.
3. Estimate the pitch diameter of the worm gear. The pitch diameter of the gear should be assumed to be tangent to the worm. Keep in mind that the OF of the gear and the OD of the worm will overlap by approximately 2/DP inches or millimeters, depending on the system.
4. Measure the center distance between the worm and gear for checking your math.
5. Using the estimated pitch diameter and DP of the gear, calculate the number of teeth. It must be an integer number.
Keep playing with your measurements and numbers until it works out. Double check that the measured center distance is equal to the calculated radius of the gear plus the calculated radius of the worm.
I left a lot of details out here, but this should get you started. The formulas for gears are easily found on the internet.
A better question would be, once you figure out the gear data, how are you going to repair it?