Is it possible or recommended to have the iTunes library on a non-permanent external drive? What will happen if I e.g. sync my iPhone while the drive is not attached? Or what will happen when iTunes thinks it should download the music I have bought on my iPad while the drive is not connected?
It is possible. In fact, I manage my family's iPod this way.
The howto is answered in How to move iTunes’ Mobile Applications folder to an external hard drive. Shut down iTunes, move your library, then start iTunes back up while holding down Option. Tell it you will choose a library, then show it your library on your drive. For more advanced library management, see Can I keep my iTunes library on an external drive?.
As for your concerns, always shut down iTunes before removing your drive. I don't know what will happen if you unplug it without killing iTunes.
If you try to bring up iTunes without your drive plugged in, you will see these two dialogs, one after the other: In the first one, simply click OK to get the second one, then quit, plug in your drive, and try again. If iTunes can't find your library, it will not try to sync your iPhone or download purchased music.