I was touched by your situation and feel badly for all involved - although this could be the start of a much better life for him. I would start by saying that I have a five year old and 18 month old. My 18 month old can be incredibly moody and throws surprising fits - and I think my kids are in a very stable and secure home. So you are in part facing an age - in case you have forgotten :) - when it is perfectly normal for your little one to be emotional and easily frustrated. I am sure his history and these changes are affecting him and making it worse, but that age is hard to start with.
Kids need consistency, stability, structure. they thrive on it. He will not see you as "Mean Grandma" for setting expectations and following through. He will develop a trust and security in you which will make him feel safe and loved. There is plenty of time for freedom and giving in to him. Now I think the more structure the better!
I believe that spanking is just plain wrong. But especially with a kid who feels insecure and may have seen some bad stuff, hitting is probably the worst thing you can do. He is already acting out physically, you don't want to model more physicality for him.
We don't really use "time outs" at my house. We simply redirect. If you aren't nice with a person or toy, then that activity stops. If you don't say please and use words (or signs) then you don't get what you want. Punishment with a toddler is rarely effective and the only time I really use it is if there is hitting, biting, etc. My older daughter started getting punished closer to three - going to a toyless room, losing a toy or a priviledge, etc. - and I felt she could understand the warning and the consequence clearly. She is a really nice kid , but gets in trouble for back talk, grabbing/pushing, etc. In my case, my older only hit or bite once or twice and the youngest never has.
My mantra is a calm demeanor - don't let them know they are frustrating you. Talk all the time, because you are really verbalizing for them, since they aren't very good at it.
That's not to say I never lose my cool because I do. But I always apologize to my kids if I yell, slam something, etc. I want them to know it is olay to be mad, but you can't act out because of it. Redirection and calmness is often easier said than done. But I find that some times the quieter and calmer I am, then the quicker the crisis passes. Let him have his tantrum, and say "Are you done yelling? Good calming down! Now we WILL clean up the toys before snack." And then help him do it, and praise his success in calming down and obeying.
As for his parents, I would give him a photo album of them, and encourage him to talk about them (or call and see them as appropriate). That won't undermine you at all - tell him that his parents are making bad decisions, but they love him and it's okay if he loves them back. But let him know that he is safe and secure with you and that he has a home with you whenever he needs it. He needs to learn, even now, that you can love people, but you can't let them hurt you and manipulate you. By gaining custody, you are taking a great step in saying that you love your child, but you love him just as much and will do what is best for him.
Good luck!