Unless they've changed the way they do business, you know before you commit (usually at the end of your sophomore year, earlier if on scholarship) if you are qualified for pilot training based on your aviation aptitude tests and physical exam. Obviously, there are no guarantees, but it's pretty near certain. Usually the worst thing that happens is there are no slots open at the particular time you graduate (big wave of new lieutenants every June, and the training snake can't swallow that bowling ball of people) and you get sent to a temporary assignment (often puttering around a real flying squadron) until a slot opens a few months later -- and you'll probably know before you graduate when that will be.
If you aren't pilot-qualified on graduation, they'll send you to do something for which you are qualified. After that, it's not likely you'll ever get pilot training unless the requirements change, or there's a change in your own status (e.g., medical issue being resolved) or the needs of the service. If that happens, and you're not already in another field they consider more critical at the time, and you're not too old at that point, you may get selected, but the chances are a lot slimmer.
As for earning civilian pilot certificates and ratings while serving in a non-pilot billet, that's pretty much the same as it would be in any nonflying civilian job. If you have the spare time and the spare money, go right ahead. In fact, you'll have the advantage of the Air Force Aero Club system to find cheaper, more convenient civilian flying, usually on base. Those FAA tickets won't count a lot for the Air Force, but they may help convince a selection board of your dedication to flying and innate ability to fly if it comes down to you versus someone who hasn't gone that route.
Finally, for service commitment for non-pilot officers, I don't know exactly what it is today, and it does change from time to time, but in the past, it was usually around four years active duty plus two more in the inactive (non-drilling, non-pay) reserve.