library(data.table)
DT <- data.table(value)

As a sigle call: 

    DT[, list(SD = ifelse(is.na(sd(STD)), 0, sd(STD))) 
       , by=list("Group" = factor(G <- (Number-1) %/% 5, labels=(unique(G) + 1)*5))]

       Group         SD
    1:     5 0.05770615
    2:    10 0.00000000
    3:    15 0.09486833
    4:    20 0.09486833


Breaking it down: 

    # you can create your groupings by 
    (Number-1) %/% 5  # (ie, the remainder when divided by 5)

    # you can create your factor levels by 
    5 * ((Number-1) %/% 5 + 1)

    # calculate the Group:
    DT[, grp := factor(G <- (Number-1) %/% 5, labels=(unique(G) + 1)*5)]

    # calculate the SD by Group, replacing NA's with 0:
    DT[, SD := ifelse(is.na(sd(STD)), 0, sd(STD)), by=grp]
    unique(DT[, list(grp, SD)])


