You can get on the treadmill as soon as you feel well enough, but your body will tell you not to overdo it. You have been through major surgery...even though you just have 5 little slits on the outside, your inside has been through a lot. I worked my way up gradually, but you'll get your strength back pretty quickly--especially if you're already in shape. Just listen to your body. If you start hurting slow it down.
As Starry said, walking will help with the shoulder pain. Believe it or not, it's a very common complaint after Nissen surgery. It's a combination of diaphram irritation and the gas they pumped into your gut before surgery, so they could see what they were doing when they operate. I found that the more I walked the less my shoulder hurt. Believe me, I feel your pain. In some ways it's the worst pain of all--at least the most annoying.
Starry is a better one to answer the caffeine question. I have a very sensitive stomach and have to drink coffee very sparingly. I can, however, drink tea, and it doesn't bother me. I started with decaf, then added a caffeinated tea bag, without any problem.
When you cough, hold a pillow tightly to your incisions. It'll help keep it from hurting as much. Also, you can ice any incision that hurts from repeated cough. I found the left rib area to be particularly painful for the longest time. I had a lung infection and coughed incessently during my recovery. Ice was my salvation. Be sure to cough and get that mucous out of your lungs.