function createWindow ()
guiWindow = guiCreateWindow ( 45, 85, 630, 492, "test", false )
guiEditBox = guiCreateEdit ( 0.0444, 0.065, 0.9302, 0.9065, "", true, guiWindow )
end
addCommandHandler ( "gui", createWindow )
Try this, however its not really good to create it everytime you type gui, you should create your window onClientResourceStart and just set the guiSetVisible true / false with your command handler