To take somewhat of a tangent approach, what you're describing sounds a lot like something along the lines of slashcode, or possibly everything engine. Could you just bastardize one of these for your creation?
Comment on Re: DBM (or something better?) question