Below is a script to do this in T-SQL only for procedures, functions and views. The key is that the procedures should only use one-part notation. That is, only Orders, not dbo.Orders. This also applies to the name that follows CREATE XXXX.
The script creates a new schema and makes a user owner of that schema. That user has the new schema as its default schema. It is also granted permission to read definitions in the dbo schema and rights to create various objects. The script impersonates that user and gets the code for objects in the dbo schema, and just re-runs them. Since the default schema is new schema, this is there the new objects will end up. The last statement REVERT changes the user context back to yourself.
However, it does not handle tables, and overall, this is not really the correct solution. The correct solution is that you have your objects under version control, and that you retrieve the objects from version control and load them through a script in Powershell, Python, Perl or whatever you like. But this script would apply the same idea: impersonate a user that owns the schema in question and has it as its default schema.
You could also work from a source schema, but you should still use a client component for the scripting of table, which is easier to do client-side, as you can use SMO and don't have to roll your own.
CREATE USER Extra WITHOUT LOGIN WITH DEFAULT_SCHEMA = Extra
GRANT VIEW DEFINITION ON SCHEMA::dbo TO Extra
GRANT CREATE PROCEDURE TO Extra
GRANT CREATE VIEW TO Extra
GRANT CREATE FUNCTION TO Extra
go
CREATE SCHEMA Extra AUTHORIZATION Extra
go
EXECUTE AS USER = 'Extra'
go
DECLARE @cur CURSOR,
@sql nvarchar(MAX),
@objname sysname
SET @cur = CURSOR STATIC FOR
SELECT m.definition, o.name
FROM sys.sql_modules m
JOIN sys.objects o ON m.object_id = o.object_id
WHERE o.schema_id = 1
AND o.type IN ('P', 'FN', 'IL', 'TF', 'V')
OPEN @cur
WHILE 1 = 1
BEGIN
FETCH @cur INTO @sql, @objname
IF @@fetch_status <> 0
BREAK
BEGIN TRY
EXEC(@sql)
END TRY
BEGIN CATCH
PRINT @objname + ': ' + error_message()
END CATCH
END
go
REVERT
go