Before I say anything else, I want to say that showing the presence of mind you did on an OW certification dive impresses the dickens out of me, and I'm pretty sure I wouldn't have coped nearly so well with sucking a regulator dry on one of mine!
As has been said, some regs free-flow when turned mouthpiece-up -- my backup reg does, too. But mine is secured under my chin, and when it freeflows, I know it immediately. When or if you buy your own equipment, you've learned a valuable lesson about making sure regulators are where you can see them and be aware of what they are doing. Whether that's fastening a standard octo in a visible and easily accessible place (and securely!) or switching to a bungied secondary setup doesn't matter as much as doing something effective.
Another piece of food for thought for your future diving is how you see yourself and other divers underwater. You were thinking about yourself -- analyzing and solving your problem. I have a tendency to want to do that, too. But some of us believe that we dive as buddies, or as teams, so that your resources are always greater than what you alone brought into the water -- Whether that's gas supply, eyes to figure out what's wrong, or brains to come up with solutions, you've got more than just you. It's totally reasonable to train yourself that your first response to an issue is to alert your buddy or buddies that something is wrong. Then everybody can think about what to do next. In this case, as several people have mentioned, sharing air BEFORE you were out might have been quite reasonable (although an air-sharing ascent is a big challenge on an OW dive!)
And just one last observation -- Breathing through a snorkel is not very efficient, and snorkelling while having to swim hard is going to make almost anybody feel short of breath and fatigued. This has to do with the length of the snorkel increasing the amount of air you have to move in a minute to keep your carbon dioxide level normal, and there's nothing you can really do about that. Snorkels are good for moseying about and looking at sea life, but they are not very good for significant exercise. Better to keep a gas reserve so you can use a regulator!