After the recent 12 hour race at your ranch I had some subtle pain in my left Achilles tendon when I walked. I didn't think much of it because of the stress riding solo in the mud for that long. However, after buying a new pair of MTB shoes and using them on a road ride, the pain flared up to the point I had to stop riding. I didn't have my inserts in the new shoes, but I put them in the next day and it felt better.
On Saturday while pre-riding the trail at Comfort this pain flared up again while pushing a lap and kept getting worse. I had trouble walking that night and iced it for a few hours on Saturday. During warm up on Sunday, I still could not put any pressure on that foot while pedaling. I considered not racing but didn't want to quit. I took 2 Advil and wrapped it.
I raced anyways. I had to use the small chain ring on a 3x9 to make the climbs and use a big gear on the flats while I used a slow cadence to not put too much pressure on the foot. Now I can't walk without a limp and it defiantly feels injured now and I can't pedal a bike. My race lap was 5 minutes slower than my pre-ride lap because I couldn't power through anything and didn't feel I could hold speed and power up when I needed too.
How should I treat this and what would cause this? What can I do to help it not flare up again?
I just turned 44 yesterday, so I don't heal as fast as I'd like anymore but don't want to stop training either.

Time to rest that foot and ankle, sounds like you have developed achilles tendonitis. Having just recovered from this myself, trigger by pushing my running up hills, I have first foot experience in this. The pushing a single speed in the wheel sucking conditions at the 12 Hours of Dirt (AKA 8 Hours of Mudfest) stressed the tendon. Treatment involves, rest and more rest. Pain is your friend here. Do not mask the pain with analgesics (pain meds) which could lead you into over doing it, but let is guide you in your recovery. Get a cane and use it every time you walk using it in your right hand putting the cane tip down every time your left foot goes down (following the natrual swing of your arms, left foot forward right arm forward) and lean into the cane to unload the left foot. You will want to avoid over stressing the tendon with such things a stair climbing or bicycling for the next 6-8 weeks. The problem is if you keep pushing it is that the inflammation can rapidly worsen leading to a weakended tendon and eventually tendon rupture which is crippling. Do use an Ace wrap or support stocking to keep the swelling down and prop the foot up when you have to sit for any period of time.

When you get back on your bike, get on a geared machine and use a high RPM spinning technique and avoid gear mashing. Do road rides first and avoid the big hills until you get your feet back under you then work your way back into the dirt but stick to a multigeared bike for the next several months to allow you tendons to adapt. You will want to work on stretching your achilles tendons as well as you go into recovery. A visit with a physical therapist can be useful here.