the standalone script creates the graphics context whereas the in-game script is already using the one from the editor and the framework has already been created in the editor... and i personally do not want engine.exe to create these things for me as i do not always use framework... its just like using a c++ or bmax program where you have to create your own graphics context and framework...
as for the standalone spinning cube example that uses framework:
require("Scripts/constants/keycodes")
RegisterAbstractPath("")
Graphics(1024,768)
fw=CreateFramework()
fw.main.camera:SetPosition(Vec3(0,0,-2))
light=CreateSpotLight(10)
light:SetRotation(Vec3(45,55,0))
light:SetPosition(Vec3(5,5,-5))
material=LoadMaterial("abstract::cobblestones.mat")
mesh=CreateCube()
mesh:Paint(material)
ground=CreateCube()
ground:SetScale(Vec3(10,1,10))
ground:SetPosition(Vec3(0,-2,0))
ground:Paint(material)
light=CreateDirectionalLight()
light:SetRotation(Vec3(45,45,45))
while AppTerminate()==0 do
if KeyHit(KEY_ESCAPE)==1 then
break
end
mesh:Turn(Vec3(AppSpeed()*0.5,AppSpeed()*0.5,AppSpeed()*0.5))
fw:Update()
fw:Render()
Flip(0)
end