Creating a script

Hello, I have a problem.
How do I in a script cause the command to be used for a while and then stop?
Like use a command for 1 minute then it stops then 3 seconds after for 1 minute it runs then it stops at the end of 1 minutes?
Thanks for your help ^^
This is what I have done so far :
Citizen.CreateThread(function()
local time = 0
while true do
if time < 60 then

        Citizen.Wait(1000)
        time = time + 1
    end
    time = 0
    Citizen.Wait(3000)
    if time < 60 then
        
        Citizen.Wait(1000)
        time = time + 1
    end
    time = 0
    Citizen.Wait(3000)
    if time < 60 then
        
        Citizen.Wait(1000)
        time = time + 1
    end
    time = 0
    Citizen.Wait(3000)
end

end)