It's very well possible that it's done from scratch; hence new ME issues that pop up every year. And as long as we haven't had a tour in SI's offices, we have no right to assume anything about the way they work.
On the other hand; I do fully agree with you that access to the source code could make things a whole lot better for individual players. I myself would have a go as well with the ME, for instance. However much of a daunting and extremely complicated task it would be, I honestly believe that access to the source code could improve game experience (for the ME). Imagine the possibilities of downloads on the fansites. And as long as SI haven't tried this in at least one version, they also don't have the right to assume that we're all a bunch of potato farmers who know nothing about coding