First of all I want to thank you for taking this Senegal in to your home, as this poor guy has been through the ringer already, and he deserves a chance at a stable, forever home. Most of the reason he's nipping/biting is because he doesn't trust people in-general, and why should he, he's most likely had at least 4 or 5 owners, if not more. And his cage-anxiety and fear is a result of the same issue, he hasn't ever had a person that he could trust, and i'm quite certain that throughout his life his cage was not a place that he felt comfort in, but rather a place where he was put to be totally ignored, or a place that was used as punishment for his biting, which his past people did not understand the cause of...poor guy.
They are so intelligent, and you have to try to think like he is thinking. Why in the hell should he trust anyone ever again? No one has given him much of a chance, instead they have just expected him to be a loving little bird, and when he bit them because he didn't want to be put back inside his cage for hours or days or weeks at a time with no attention at all, his people just got rid of him. This is all too-common, and as long as you are willing to put in the TIME and have the PATIENCE with him that it's going to take, this little guy will eventually be a very loving, affectionate, bonded bird for you.
You've been given very good advice above, these are all good rules to follow...The way I see this situation, you have 2 issues that you need to overcome, and 2 major goals that you need to accomplish:
#1) He doesn't trust you or any other person, as he's never been given any reason to do so. So your first goal is to EARN HIS TRUST AND GET HIM TO THEN BOND CLOSELY WITH YOU, WHICH WILL HAPPEN QUICKLY ONCE YOU EARN HIS TRUST.
#2) He looks at his cage as a bad place rather than a place of comfort and fun. He's probably been biting/nipping for a long time, especially when being put inside his cage, and his cage was probably used as punishment for the biting/nipping, which is a big no-no, you can see why. This became a circular catch-22 type of situation that just got worse and worse, and he now looks at his cage as a place that you're going to lock him in and leave him alone in for hours, maybe days at a time without giving him any attention, thus he bites you when you try to put him inside it, or even when you simply try to put him down and off of you. He can't entertain himself because he's too preoccupied with not losing sight of you and worrying about if he's every going to see you again. So your goal here is TO MAKE HIS CAGE A PLACE OF COMFORT, A PLACE HE CAN ENTERTAIN HIMSELF, AND MOST IMPORTANTLY TO GET HIM TO UNDERSTAND THAT YOU'RE NOT GOING TO JUST LOCK HIM IN THE CAGE AND LEAVE HIM FOR LONG PERIODS OF TIME.
***The best way I've found to fix BOTH of these problems at the same time with the same solution with rescue-birds who have had many homes since they were babies with many owners is:
#1) Locate his MAIN CAGE in the room of your house where you spend most all of your time when you're at home. This is crucial, as he needs to learn that he can feel comforted, safe, secure, and that you're not going to leave him when inside his main cage. A BIG PROBLEM-STARTER IS PEOPLE WHO KEEP THEIR BIRDS IN A CAGE IN A ROOM THAT IS AWAY FROM THE ACTION IN THE HOUSE AND WHERE THEY SPEND MOST OF THEIR TIME, USUALLY A SPARE BEDROOM, AND ALSO IN A ROOM WHERE THE BIRD CAN HEAR THEIR PEOPLE/PERSON AND KNOW THAT THEY ARE HOME, BUT THEY CANNOT SEE THEM AND THEY FEEL THAT THEY ARE BEING IGNORED AND LOCKED IN THEIR CAGE ALONE...
#2) Get him a secondary SLEEP CAGE that is much smaller, contains NO TOYS OR ANY ACTIVITIES, just a water dish and a swing if he likes to sleep on a swing, and locate his sleep cage in your bedroom where you sleep at night. This accomplishes 2 things, it again reinforces that his cage is a place where he can feel secure and comforted, and it also reinforces that he can again be inside his cage and yet still be near you and not be left alone or behind.
I cannot tell you how many posts I've seen where a person has just brought home a new bird, hand-raised bird that is tame, and they've had him for a few weeks to a month, and the bird is not only biting, but he's refusing to go into his cage, biting when he's put in his cage, and crying constantly once in his cage. The very first question I ask is "Where do you have his main cage located in your home?", and 99% of the time it's located in a room that is away from where they spend most of their time at home. So they are expecting their bird to bond closely with them and want them to be affectionate with them, yet they keep them locked inside the cage in a room where the poor bird can hear them, knows that they are at home, but where they can't see them. And when we're talking about a bird who is an adult, who is very intelligent, and who has had at least 4 or 5 owners already and has been given absolutely no reason to trust any human being at all, nor trust that his cage is not simply a prison where they are to be ignored and forgotten, this just makes everything a million times harder and more complicated.
He needs to learn to associate his main cage with comfort, security, having fun, etc. And right now, as you said, he's acting extremely CLINGY to you, and he doesn't want to go inside his cage at all, and when you try to make him go in his cage he bites you. Makes perfect sense to me...And realize that you don't have to be spending every minute of every day interacting directly with him in order to help him and fix this issue at all, you just need to make him feel like he's a part of your family, like he's included in what's going on, and PUT HIM IN THE MIDDLE OF THE ACTION IN YOUR HOME, INSIDE HIS CAGE! This will solve BOTH PROBLEMS! The final goal by doing this is that you will be able to sit on the couch and watch TV, read, play video games, or be in the kitchen cooking, or whatever it is you do when you're home, and he will be content to be inside his cage playing with his toys, doing foraging activities, napping, etc. because HE'LL KNOW WHERE YOU ARE, HE'LL BE IN THE SAME ROOM AS YOU FOR THE MOST PART, HE'LL FEEL LIKE HE'S A PART OF THE ACTION IN YOUR HOME, AND HE'LL ALSO REALIZE THAT YOU'RE NOT PUTTING HIM IN HIS CAGE AS A PUNISHMENT OR BECAUSE YOU ARE WANTING TO IGNORE HIM OR PUT HIM OUT OF THE WAY. A bird that can hear his person is home but cannot see his person is a very stressed-out bird.
For Example, if you spend most of your time in your living room, or if the living room is the room of your house where most of the "action" is, meaning that's where most of the people who live in your home spend most of their time, then that's exactly where you need to put his larger, MAIN CAGE. Make sure that he has tons and tons of toys to play with, things to chew on and rip apart, and foraging activities inside his cage at all times, and rotate them at least monthly so he doesn't get bored. THE RESULTS THAT YOU'LL SEE BY DOING THIS ARE TWO-FOLD, AS HE'LL NOT ONLY START TO ENJOY SPENDING TIME IN HIS CAGE, BUT HE'LL ALSO START TO BOND MORE AND MORE CLOSELY WITH YOU. He'll stop biting you when you tell him it's time to go in his cage because he'll now know that even though he's in his cage, you're not leaving him, you're not ignoring him, and he can actually feel comforted and have fun inside his cage. AND THIS WILL HAPPEN ALL BECAUSE HE IS INSIDE HIS CAGE BUT STILL RIGHT AMONG THE ACTION AND PEOPLE IN THE HOUSE, AND BECAUSE HE CAN SEE YOU WHILE HE'S INSIDE HIS CAGE....
And getting him a separate SLEEP CAGE will also reinforce the same goals and ideas. YOU NEED TO REALIZE THAT THIS SENEGAL IS NO-DOUBT SUFFERING FROM A PRETTY LARGE AMOUNT OF SEPARATION ANXIETY. So yes, it's going to be difficult for him to not be with you all the time because he thinks that you're going to leave him forever, just like every other person in his life has. But what you need to teach him is that he does not have to be in direct contact with you at all times to feel comfort in your presence, as well as teach him to entertain himself. So again putting him in another cage to sleep, but TO SLEEP IN THE SAME ROOM AS YOU, will reinforce that his cage is a place of comfort. And this cage should be very small, my Senegal sleeps in a square Budgie cage i bought at petco for $39, and it's perfect. It has a water dish and a $5 wooden/metal swing that he usually sleeps on, and it sits right next to my nightstand. I cover it with a blanket or dark sheet, and he beak grinds for a good 30-60 minutes before he falls asleep he's so relaxed and happy, just knowing that I'm right there next to him. He goes in it willingly, as well as his main cage now.
The way you need to think, at least for the next few months until you do earn his trust, is that WHEN YOU ARE AT HOME, HE NEEDS TO BE IN THE ROOM THAT YOU'RE IN, BUT NOT NECESSARILY ON YOU OR DIRECTLY WITH YOU. And he'll be just fine with that after he realizes that he's happy that you're just there with him, even if you're not touching him or talking to him. So make sure his main cage is located in the room where you spend most of your time at when you're at home, and when you are at home and not directly interacting with him, try to be in the same room as his main cage doing whatever you're doing. You'll be shocked how quickly he'll start to love to go in his cage and play with his toys, take a nap, etc. as long as you're within his sight. Same thing with the sleep cage at night. Pretty soon you will earn his trust, he'll start trusting his cage, and the biting will stop. And he'll start to willingly go into his cage, because he will have learned that it's a comforting, fun place to be, and it doesn't mean that you're dumping him or leaving him. And he won't have to hear his people/person without seeing them, that's a big deal...