While it sounds like an interesting excercise if performed carefully, I have to join the others in questioning it's usefulness in the real world.
From one experience, which happened during my teen years, I think that being attacked on a remote trail is very much a real-world possibility. My action was to veer down a different fork in the trail, which was conveniently available. While armed resistance was not indicated at that point, those dumb-red-necks were not friendly, and I am grateful they decided to stay at their spot by the water, and not get into their truck to pursue.
(Yes, I said dum-red-neck. Those of us who grew up in rural and semi-rural Texas know what constitutes the "dum" part. Like so many terms, "red neck" is a relative term, and in a different context, I might claim the title of red-neck, myself.)
Moreover, I belong to Bikeforum.net, and accounts of brutal attacks against cyclists are posted there from time to time. It happens.
I do not practice shooting while riding, however. If I am moving, it seems that maintaining control of the bicycle trumps firing a weapon, and I can be VERY clumsy when riding with less than two hands on the handlebars. I envy those who can open a snack, or don or shed a jacket, while pedaling. It is perilous for me to reach for a water bottle and take a sip.
The only time I can see myself shooting while riding would be to keep a pursuing bad guy from catching up with me, if he had a contact weapon, or a clear physical disparity of force advantage. The more likely choice would be to stop and engage, rather than allow myself to be tackled or injured with a contact weapon while in motion. If the bad guy has a firearm, well, I cannot outride bullets, so transitioning to pedestrian status might be indicated.
As Cosmoline indicated, airsoft might be the best way to practice this. I cannot think of ANY shooting range that would allow live-fire practice in this manner, if the shooter was willing to take the personal risk!
Hmm, I do seem to remember my employer, a PD, offering a "tactical bike patrol" class. I highly doubt, however, that shooting while in motion on the bike would be part of the curriculum. I'll bet it advocated dismounting before shooting. In any event, my PD has "sim guns" for stuff like that. I will try to remember to ask one of the bike patrol guys about it.