Something like this should work:
DECLARE @Date date = GETDATE();
WITH cteStageCounts (stage_count) As
(
SELECT 0
UNION SELECT 1
UNION SELECT 2
UNION SELECT 3
UNION SELECT 4
UNION SELECT 5
),
cteStages (NextStage, Date_NextStage) As
(
SELECT
HPM.AddMonthsToDateAndCreateStage(@Date, stage_count + 4),
DateAdd(m, stage_count + 4, @Date)
FROM
cteStageCounts
),
cteStagesToCreate (NextStage, val) As
(
SELECT
NextStage,
HPM.AddMonthsToDateAndCreateStage(Date_NextStage, -120)
FROM
cteStages As S
WHERE
Not Exists
(
SELECT 1
FROM HAS.HPM.StagesBackup As B
WHERE B.Stage = S.NextStage
)
)
INSERT INTO HAS.HPM.StagesBackup
(
STAGE,
W1_HAS
)
SELECT
NextStage,
val
FROM
cteStagesToCreate
;