For starters, this:
(setq oldsnap (getvar "osmode"))
(setvar "osmode" 0)
(setq oldsnap (getvar "blipmode"))[color=red];Sorry Brad, this was Adesu's mistake, not yours. I just now saw that.[/color]
(setvar "blipmode" 0)
...
(setvar "osmode" 0)
...
(setvar "osmode" oldsnap)
(setvar "blipmode" oldblip)
(setvar "cmdecho" 1)
the variable oldnanap gets set as the value for osmode, then you proceed to set osmode to 0 and replace blipmode's value to the variable oldsnap. Now the value for oldsnap is either 1 or 0. Further down the line, without having changed osmode from 0, you change it to 0 again. Then at the bottom, you are changing osmode again to a value derived from blipmode, which is 0 or 1, so depending on what was set, you'll either end up with no running snaps or endpoint. Finally, oldblip was never created and I think what DGC is referring to and then you hard set cmdecho to 1. I see it as just an oversight, but it appears you meant to set blipmode to oldblip. Also, you'll want to get the value for cmdecho in a variable in the beginning and then turn it off if that is what you so desire, then return to the original value when you're done, not hard code it.