Sorry your logic is a bit unclear to me.
Do you first enter this scopes in the Custom table and need to find that when rendering/editing a page?
When someone edits a page you want to insert a new "scope" in the Custom table automatically?
And what type of value would such a "scope" be? A category you determine, a property on a users profile or the specific section in the content tree the editor currently is at?