"better" needs a metric against which to judge candidates. How do you define better?
Similarly, how do you define "secure"?
Some questions:
Why pass the body of the function as a character string (as well as the name of the function, when you could simply pass the function itself?
I don't understand the need for a sandbox environment. Please expand on you logic.
Please show how you are calling summarise_per_week inside shape_logdata. Your current example is not at all clear.
"obviously the dataframe is not available to the function when run inside a Shiny app". Based on the information you've provided, it's not at all clear to me that the problem is that the data.frame is not available.
I wonder whether this is may be an XY problem: why not provide the functionality you want to give users in a package and load the package as part of the app's start up? [That's the way I would (and have) addressed similar issues, but I accept the suitability of that approach may depend on what you mean by "better" and "secure".]