There shouldn't be any long-term effects to your walking the distance, if you choose. But you will likely feel the pain afterwards, and maybe for several days.
As Rhonda said, it's not a matter of your muscles being weak -- it's the nerve signals not getting through properly, so they're having to overcompensate -- overwork --to achieve the same goal, the distance you want to walk.
Generally at those MS walk things, if you tell them before you start that you have MS, there's somebody willing to sort of keep watch, and if you do find yourself unable to continue, they'll come "rescue" you, with either a wheelchair so you can continue, or drop out.
It does sound like spasticity, and yes, that and an overall worsening of MS, progression, is what leads at least some of us into a wheelchair full time. My leg muscles haven't atrophied (shrunk) -- they just don't get signals from my brain anymore, sufficient to hold me up for more than a few seconds (I stand in front of my chair), or a step or two to transfer to another chair.
Good luck with the walk, and thanks for doing it!
...I am not a doctor, nor health professional, and don't pretend to be one, here.....