I heard a hidush on the name of rav ovadia, in case someone is doing shemona esre by heart and in the middle can't remember some part, if there's no sidur in reach he can walk get the sidur, go back to his place and continue, since leaving the place is miderabanan and beracha levatala is mideoraita.
in this case I think you could leave your place do whatever necessary, go back and continue. all of course if you didn't speak. if you did speak that would be more complicated.
also I don't know if asheknezim poskim if beracha levatala is deoraita and if it would make a difference