If you're creating a new window object, there's no need for a self parameter. Instead, create the new instance within the MyClass.createWindow function. Do this either by using a table constructor ({}) or by calling another constructor function. Example:
local oldCreateWindow = GUIclass.createWindow
function MyClass.createWindow(...)
local window = oldCreateWindow(...)
local foo = window.attributeOne
-- do some more stuff wich requires foo
return window
end
I think I understand your problem better now. I believe you'll be better off with a closure than with a class.
-- MyClass is actually just a table with lots of attributes that change a lot.
local MyClass = {}
local function createWindow(arg1, arg2, arg3, arg4, arg5)
local foo = MyClass.attributeOne
-- do some more stuff wich requires foo
return window
end
GUIclass.createWindow = createWindow
After that, any changes you make to MyClass should be visible to GUIclass.createWindow.