I think you were fine. I've cashiered at a number of jobs (one grocery store, and a few food service). If she's normally very reliable and has no history of problems, she'll probably be fine. She may get a talking to, or some sort of official warning, maybe, but I'd be surprised if a one time thing gets her fired. If there is a pattern with her, then she's probably better off in a different field anyway, and it's certainly not your fault.
On the other hand, if you hadn't returned, she may have come up $20 short, which may well have been docked from her paycheck, as well as being written up. She'd get in trouble anyway, at least this way she isn't also out $20. Going through her line would have been confusing, time consuming, and seeing her exchange money, but no goods, may have been looked at suspiciously.