Custom block template PHP page, possible to make content editable in UI?
What you're describing is already in Drupal 7 core. It's called the Contextual Links module. When enabled, modules can define menu paths that enable a set of links that is contextually relevant to the content.

In your case, a user with Use contextual links &amp; Administer block permissions will see a gear icon that produces a dropdown link from where they can configure &amp; edit content of any custom block.