I would realize this in a three step approach:
df <- read.table(textConnection("
V1 V2 V3 V4 V5 V6 V7 V8
0 -232 -77 -1 D dog 0 0
1 -231 -77 0 C cat 0 40
2 -230 -77 1 T tai 0 0
3 -229 -76 -1 F fis 0 0
4 -228 -76 0 G goo 0 100
1161 929 310 -1 S soo 0 0
1162 930 310 0 B bye 0 0"), header=TRUE)
# condition 1
a <- df$V4 == 0 & df$V8 > 30
# condition 3 (does the row 3 rows above fulfill condition 1?)
aIdx <- which(a)
b <- (aIdx-3) %in% aIdx
a[a] <- b
# condition 2 (select also the next two rows)
i <- rep(which(a), 3) + 0:2
a[i] <- TRUE
df[a, ]
# V1 V2 V3 V4 V5 V6 V7 V8
# 5 4 -228 -76 0 G goo 0 100
# 6 1161 929 310 -1 S soo 0 0
# 7 1162 930 310 0 B bye 0 0