This is what we did at ILM, with our in-house software package Zeno. The lowest level of complete functionality was the "Sg" namespace (short for Scene Graph). Above that lived user-and-SDK-friendly commandline utilities layer (SgCmd) that was used for all scripting. Above that, finally, was the Oz layer -- the graphical UI. Oz actions called SgCmds, but never saw or touched the Sg layer.
In theory, Oz was UI toolkit agnostic but, as anyone who's ever done UI work will understand, it rapidly became wedded to the toolkit we used (a heavily customized version of Tk). This made the eventual switching to Qt very, very difficult. So difficult it nearly destroyed the artists' faith in the R&D group. (Extremely late delivery, buggy, and coming at the manpower cost of not doing any improvements on the tool itself for a year and a half.)