I think this will work if you first store the CREATE TABLE and CREATE PROCEDURE commands as string variables, and then run EXEC on those variables. Try something like the below:
DECLARE @intFlag INT,@table nvarchar(300), @createTable nvarchar(300),@proc nvarchar(300), @createProc nvarchar(300)
SET @intFlag = 1
WHILE (@intFlag <= 99)
BEGIN
SET @table = 'wt_sequence_KOIID_' + cast(@intFlag as nvarchar) + '_seq'
SET @createTable = 'CREATE TABLE ' + @table + '(dummy CHAR(1), value BIGINT IDENTITY(1,1))'
EXEC(@createTable)
SET @proc = 'wt_get_next_sequence_KOIID_' + cast(@intFlag as nvarchar) + '_seq'
SET @createProc = 'CREATE PROCEDURE ' + @proc + '(@returnValue BIGINT OUTPUT)
AS
INSERT ' + @table + ' (dummy) VALUES (''x'')
SELECT @returnValue = SCOPE_IDENTITY()'
EXEC(@createProc)
SET @intFlag = @intFlag + 1
END
go