I noticed that I lost one of the two small screws on the rear derailleur hanger attaching the hanger to the frame on my road bike. Might there be something wrong with my shifting that caused that? Also, it it safe to ride until I find a replacement bolt? I imagine the QR screws should be enough to hold it in place right?
Yea, the QR will hold it on tighter then the screws could ever dream of.
If you ever need to remove the wheel though, be extra careful as the one remaining screw has a higher risk of breaking when it doesn’t have a second screw to share the load. The load is from the derailleur’s weight, chain tension, and the wiggling you might need in order to remove the wheel.
To answer one minor unaddressed points: it's not your shifting that caused one of the screws to back out. Several of the sites I've Googled, such as this one, say that vibration is a common cause of bolts backing out like yours did. Bikes obviously experience vibration. However, most of our bolts stay put. I would guess that for whatever reason, the bolt in question was not tightened enough to begin with. There are other possible contributing factors, but I believe they don't apply on bicycles (especially differential thermal expansion).
I'm not finding clear torque specs for derailleur hangar bolts. A few forum posters guessed no more than 5 Newton meters, but it may depend on how big the bolts that mount the hangar to the frame are. I believe that mine are dual 3mm or 4mm hex bolts, which I think is probably consistent with a spec of 3-4 Nm. (NB: I haven't confirmed this.) It's difficult to convey torque in subjective terms, but this would be harder than you'd achieve with just two fingers (I'd call this finger torque; this is probably less than 2Nm and it's the spec for Shimano cranks' top caps), but less than you should tighten a thru axle.
If your bolts keep backing out despite reasonable torque, I would be surprised, but the standard solution is loctite. This is a thread locker that comes in various strengths. I'd suggest blue (red and green are stronger; blue is designed so that you can still remove the bolt with hand tools). In my experience, you usually don't need loctite on the bolts for most parts, but it's not useless to have a bottle around the house if you work on your bike. If this is the only time you'll ever use it, ask your bike store if they can loctite the bolts down for you. If it's just loctiting a couple bolts, a lot of places may just do this for free.