The only prevention advice I can give you is to read over your question before submitting, and make sure that both the title and body are:
- Asking the question you intended to ask
- Asking the same question
- Quite clear about the question you're asking
For the third bullet, something I've seen other users do (and which I've done as well) is to write a one-sentence "thesis" summary of your question, in bold, at the bottom (or top) of your question post; for example.
However, how effective that is going to be for prevention is...variable. The StackExchange model puts the burden of moderation on the community, so all users have the responsibility to make sure the site is the best it can be. Many times that's a judgement call, and sometimes it just happens that some users disagree over that judgement call.
So rather than prevention, there are a few things you can do for recovery:
- If the edit was suggested by a user with less than 2000 reputation, you can reject the edit (if you get to it quickly enough), and it won't appear at all
- Users with more than 2000 reputation aren't subject to community approval on their edits, but you can always roll back edits if you feel they overstep
- You can also make further edits to bring the question back into line with your intention
If your question is closed incorrectly (or what you feel to be incorrectly), you have options for that, as well:
If you edit your post within five days of it being closed, it's automatically put into the reopen queue, where users with 3000 or more reputation can choose whether or not to vote to reopen it. Users often take this opportunity to edit to explain why the duplicate target doesn't adequately answer their question
If you have at least 20 reputation, you can go onto chat. Mos Eisley, the main site chatroom, is often quite bustling, so there are lost of people who can discuss the issue
You can post on meta, as you've done here. Meta gives you a chance to make and defend your case, and it gives close voters the same chance. One possible outcome is that you change people's minds, another is that the close voters change yours. Either way, the community as a whole wins.
I should mention as well that all questions posted on Meta.SFF are automatically posted in the main site chat room.
As an absolute last resort, you can flag the question for moderator attention. Custom flags are only visible to site moderators, who have the power to immediately reopen a question. I would caution you against using this option, though; moderators are supposed to defer to the community, so unless you've been the subject of truly egregious abuse, posting in chat or on Meta is a better option
I appreciate that this has been a frustrating experience for you, but I feel like I should emphasize that this is an example of the system working as intended. One user, acting within the scope of their authority, made a choice that was perhaps questionable (I'm not here to judge that), which resulted in some behaviour that was perhaps undesirable; you drew attention to that, and the community course-corrected.
Your frustration with the process is understandable, but I hope that you won't lose faith with the StackEchange system as a whole. It really is quite good, even if it's not always perfect.