If you want to reuse the Garden of Glass functionality, you need to have the GoG mod running. You can then just extend the gardenofglass:pebble_sources block tag to make right-clicks on other blocks also produce pebble. By default it covers all blocks in the mineraft:dirt block tag already.
Without GoG you will need to implement this yourself somehow, and definitely need to ask in a KubeJS place about this.