If a person is in middle of Shemoneh Esrei and needs a siddur to say Yaaleh Veyavo, which he doesn’t know by heart, the Debriciner Rov (Be’er Moshe 3:13) rules that he may walk away from his place to get a siddur, since his davening is not valid without Yaaleh Veyavo.
Even though you are yotzei Shemoneh Esrei if you didn’t say Al Hanissim, nevertheless, the din remains the same and you may go get yourself a siddur right in the middle of Shemoneh Esrei.
The Debriciner Rov gives two reasons for why he unequivocally allows this. Firstly, we don’t find walking to be a hefsek anywhere. Talking is a hefsek, walking is not.
Secondly, he says that since it is letzorech tefillah, it is not considered a hefsek in any event. Furthermore, he says that if a sefer fell on the floor and it is disturbing you from davening Shemoneh Esrei, you may leave your place to pick it up.
Nevertheless, in both these cases, he says, if possible, it is better to motion to someone who is not davening rather than going yourself.