RStudio replaces the utils :: View utility with its own function when it starts. Their source
function (...) .rs.callAs(name, hook, original, ...) <environment: 0x1036a6dc0>
You cannot just copy this into your package, because it depends on what happens in this environment, and there is no way to get your package.
However, you can do this:
myView <- function(x, title) get("View", envir = as.environment("package:utils"))(x, title)
and export myView from your package. If you run this in RStudio, you will get their function, if you run it somewhere else, you will get the usual one.
source share