Selvig was no longer needed once the tesseract left earth. So he just went back to what he was always doing and probably is called into consult when needed.

Now Banner showed up in IM3 just because Ruffalo was in the vicinity at the time. It's not like CATWS where Widow actually a costar.

Now Selvig went went nuts because his mind found it difficult to deal with the calculations. We kinda see his insanity already when he is freed. Given how Hawkeye is fine afterwards, I assume his mental facilities are fine. Though keep in mind that he did kill innocent people so he may not remain with shield over guilt.