As I was getting out last night, I uncharacteristically forgot the car in R, with the handbrake on; engine was off. This morning everything seemed ok, but I was still slightly worried. Specifically - could I have damaged the gears or parking pawl by keeping it in this state for 12 hours? Could I have drained the battery by running parking lights with the engine off? Could it have rolled off and I just got lucky?
The handbrake will accept outside forces up to a certain limit. If your vehicle was parked on a level or near-level surface and did not begin to move from gravity, the handbrake was providing the necessary force to prevent damage to the transmission. As it is an automatic transmission, there is also a fluid coupler known as the torque converter providing a disconnect between the wheels and the engine.
A manual transmission in reverse would transfer outside forces to the engine. Compression in the cylinders is sufficient to prevent movement on level and near-level surfaces. Greater slopes require the handbrake to restrict movement and in extreme cases (large heavy vehicles, severe slopes) wheel chocks would be required.
Your second question is unrelated to the first. If you leave any electrical device in an operating state, the battery could be drained over sufficient time. As is, the question is ambiguous.
"Could it(?) have rolled off..." The battery? A disconnect of the discussion makes your third question ambiguous. Allowing for a reference to the first question, it's unlikely that your vehicle could have rolled off, if your handbrake was set firmly enough AND an outside force acted upon the vehicle.