The pain you're experiencing here is the impedance mismatch between the functional-reactive style that Shiny is designed for, and the imperative style ("on click, do this action") that most other GUI frameworks use (certainly most of the ones written before the last 18 months). I believe the functional-reactive style leads to much simpler and concise code, and far fewer errors for 90% of cases, but when you start wanting to do things that are by nature imperative (such as saving to the database) then it starts to get... interesting.
I have some ideas about how to allow you to move between one style and the other, but would like to spend a while longer watching what people are trying to do before implementing anything. In this case it seems like your problems could be solved by having a way to access reactive functions/values without actually taking a dependency on them (so that the code doesn't re-execute). Something like:
observe(function() {
input$add # take a dependency on the action button
nonreactive({
# Some logic
saveToDatabase(input$foo, input$bar, input$baz)
# Some more logic
})
# Or another way
saveToDatabase2(nonreactive(input$foo))
})
So this observer would execute when input$add is clicked, but not when input$foo, $bar, and $baz change. "nonreactive" is a terrible name, but hopefully you get the idea.
Any thoughts?