you'll be fine if you sign out. If you forget, there is a certain period of time (I don't know how long though) that he can start downloading apps without a password. So just remember to sign out right away.Well it won't be a problem if I do the sign in and signing off for him? He won't know my password.
Just make sure he authorizes your computer that you sync with as well.Technically you can. You need to sign into your friend's iPhone with your iTunes account and download the same app again. It will ask if you want to re-download and you say yes and there you go, you've "shared" an app. My wife and I use the same iTunes account and that's how we've been doing it since the app store came about, though she just leaves her phone signed in with my account.