There's probably a more elegant way, but this might work for you. In this case, I'm saving a new log file after each step, to avoid causing problems if you want to open up the log file while the script runs.
There might be a way to use purrr::walk or safely to have it write a single log file, but fail gracefully if you happen to have opened the log file. In that case you'd miss updates until you close it. (Unless the failed open triggered a new file name... but then maybe it just gets too messy.)
library(tidyverse)
log <- tibble(timestamp = character(), note = character())
for(t in 1:10) {
# Do one step of your long script here
Sys.sleep(1)
# Add a row to the log
log <- log %>%
add_row(timestamp = Sys.time() %>% as.character(),
note = paste("Hello step", t))
# Save a new log file
write_csv(log, path = paste0("log_step",
stringr::str_pad(t,3,pad = 0),
".csv"))
}