Translation:The history of Esperanto had been written many years ago.
No; "was written" indicates that something took place then, while "had been written" indicates that something had already taken place before then.
"When I came home, my mother was cooking dinner." - She was still doing it at the time when I came.
"When I came home, my mother cooked dinner." - She started doing it when I arrived.
"When I came home, my mother had cooked dinner." - The cooking was already finished before I arrived.
"Had been written" is like the "had cooked dinner" sentence - it indicates that the writing was completed before the time that we are talking about, before the time "many years ago".
"Was written", on the other hand, is like the "was cooking dinner" or "cooked dinner" examples - it indicates that the writing took place at the time we are talking about (not before), so during the time "many years ago".
That's not was mizinamo was talking about here, though. Jamthom8 is talking about active versus passive, and mizinamo is talking about the simple past tense (in the passive, in this case) versus the past perfect.
Here's an alternative example to try to make it clearer:
"was written" is simple past (in the passive), e.g. "The history of Esperanto was written many years ago." (This sentence stands alone and does not imply anything else.)
"had been written" is past perfect (in the passive), e.g. "The history of Esperanto had been written many years ago, but Joan hadn't discovered the language until she was 65." (The past perfect often pops up in fiction-style past-tense writing such as in this second sample sentence, in order to indicate what the "actual past" is for characters whose present moment is already being described – thanks to the conventions of fiction – with the past tense.)
I don't know about linguistic terms, but "was written" and "cooked dinner" are still not the same. "Was written" would go with "was cooked" and you could say something like "pheasant was cooked that way for many years before the new chef arrived" or "pheasant had been cooked that way for many years before the new chef arrived" and both mean the exact same thing. Both forms are covered by the same form in Esperanto: "estas [ ]-ita".
"No, "was written" is not the same as "had been written". "The history of Esperanto was written many years ago" means that many years before now, someone wrote the history of Esperanto. "The history of Esperanto had been written many years ago" means that many years before now, the history of Esperanto had already been written. I think that is what is known as the pluperfect tense.
Yes, it can mean either.
I suppose if you really want to distinguish them you could use "estis estinta skribita" for "had been written" (the first "esti" being auxiliary for establishing time, the second "esti" being auxiliary for passive, and then the main verb), but that seems really clumsy to me.
I'm not sure of a good alternative for "was written"; "estis estanta skribita" seems to be the wrong tense.