I think the first instance of games being separated from the "engine" so that you could make the game and it would run on all platforms that the engine ran out without porting was Infocom's Z-machine. http://maher.filfre.net/if-book/if-4.htm
There was an interesting article which I read a long time. It's linked to from the post above called "How to Fit a Large Program into a Small Machine" published in 1980.
AGI, SCI, Scumm etc. were all larger and more capable versions of this.