Awesome idea. If I may add a suggestion to this:
how about using special items for programming which represent certain expressions and functions?
For example and IF item and an ENDIF item.
Or for functions for example a MINETHIS item and then with the possibility to suffix it with a certaom block you want the droid to mine like for example an iron ore block or just a wildcard item.
Oh and Kinda like you have the TFBPs for terraformers, you'd have to craft these code items.
Also, how about using a central control unit where you place the code? Droids assigned to that CCU would then execute and operate according to that code.