Here is what I think:
Well Ticce be careful about the form of the sentences. You are not asking a question and you shouldn't put the axuilary verb, here it is second was, in the first place. To be more open,
I was wondering what your name was.--- what your name was is a noun clause. In this sentence you tell us that you forgot what his/her name was. BUT if you say, sorry, what was your name? in a proper text , this will be a question form and because of this the place of was changes. Therefore, first sentence is okay but not the second one.
I was wondering what the right way was to do it. -- This is the correct sentence and the same explanation I did for the first sentence goes for this too. Go for? I mean the same reason is valid for this sentence too. This sentence just tells us about a statement made by someone but if you say what was the right way to do it? you ask a question and possibly someone will tell you do this, do that etc. to explain the right way of doing it.