I have a script called foo.R that includes another script other.R, which is in the same directory:
foo.R
other.R
#!/usr/bin/env Rscript message(\
This works for me
library(rstudioapi) rstudioapi::getActiveDocumentContext()$path