> Was I right to edit the question?

Yes. Your suggested edit was fine:

- it didn't change the original intend of the question
- it improved the content of the question
- it added additional information that the author has posted outside the question.

However, your edit summary suggested that you actually added an answer into the question. Also, even though *"how can i add "\n\t" between elements"* and *"How can I insert a tag on a new line with proper indentation?"* are semantically the same, the latter focuses on the insertion of the tag, whereas the first focuses on `"\n\t"`. 

This probably lead to the rejection: a bunch of code of unknown origin (reviewers can't see the answer), and a changed question sentence. As Mat noted, a longer edit summary would have helped.

For the next time:

- make sure that your edit summary contains all information a possible reviewer needs,
- make sure that the original intend stays the same for a reviewer.

### See also
- http://meta.stackoverflow.com/questions/274449/clarification-for-suggested-edit-rejection?rq=1
- http://meta.stackoverflow.com/questions/286991/suggested-edit-rejected-even-though-it-follows-suggested-guidelines?rq=1