It's absolutely worth a shot.
They are monogamous and will share a burrow - and not just for the mating season, but permanently (and most
Alpheus spp. are this way - see the links at the bottom). I would assume they have two separate sexes (i.e. that they aren't hermaphroditic), but I don't know for sure. Additionally, I'm not sure how to sex the shrimp, but I've heard it's quite difficult to do without taking the shrimp out of the water.
If you're careful with the pairings, you can get two gobies and two shrimp living and breeding in the same burrow:
"When the sexual maturity is reached, normally a pair male-female of gobies shares the same burrow together with a pair of shrimps."
(Quote from the reefs.com article linked below.)
A quick note here on pistol shrimp diet - pistol shrimp do not seem to be predatory, rather they seem to be more opportunistic, omnivorous scavengers (the only "hunting" that seems to take place outside of the burrow is done by the gobies, not the shrimp, and - to my knowledge - no one has ever confirmed if the shrimp actually eat the "prey" brought to them by the gobies; it might be that the goby eats them rather than the shrimp, or the shrimp might eat them as people generally assume):
link.springer.com
For examples of the shrimp and goby pairings (both in and out of aquariums), see these links:
Coral Reefs, thousand of species, thousand of associations: but the relationship between little gobies and their shrimp partners is one of the most famous and better balanced, where everybody wins and nobody loses. A wonderful example of mutualistic symbiosis.
reefs.com
Abstract. We investigated aspects of the breeding biology, including the reproductive period, egg production, and heterosexual pairing of the snapping shri
academic.oup.com