Programming INSIDE a game?

Hi all! My latest project is a project I am putting together to try to teach programming, specifically the logic of how to think through problems, and how computers know absolutely nothing. So what I am trying to do is make a simple “programming language”. Basically just a bunch of global functions that the user can access to make their in game robot do something. I have that part down, however I need help allowing the user to use these functions inside a javascript file without having to decompile the game. Is this possible? I was thinking I could do this via a custom file editor within the game, but even referencing an external file would be even better. How could i accomplish this? Thanks in advance

Try this Javascript example just to get started. Attach this to a cube or something, then in the text area, type something like

var console : String = "";
var input : String = "";

function OnGUI()
{
	GUI.SetNextControlName("User");
	console = GUI.TextArea(Rect(0, 0, Screen.width, Screen.height / 16), console);
	GUI.FocusControl("User");
	if(Event.current.keyCode == KeyCode.Return)
	{
		input = console;
		console = "";
		eval(input);
	}
}