First, let me express my empathy for your stressful and potentially terrifying situation. I've had a lot of experience with cancer in my family over the years and understand the hardship it brings to all involved.
That said...The thing that stands out to me about this whole situation is the "expected" and "accepted" part of her behavior in the hospital.
I think it's a desperately thin line to walk when all you want to do is comfort your baby and give her every little thing she needs or wants because "isn't she suffering enough?" The problem with that kind of thinking is, it negates the fact that she is still barely a toddler and 'in training' to become a polite and responsible adult. Try not to lose sight of the long run in liu of the current situation.
I think you could probably be understanding AND compassionate in regards to the medication making her moody, while still (at least attempting to) teach her self-management skills? Maybe if you don't jump when she says jump EVERY time she desires something she'll remember that sometimes life makes you wait?
While it's true that being 2.5 years old and having cancer ISN'T the normal experience of life...the hope and prayer is that she WILL make it out into the normal world and our job as parents is to make sure she's properly prepared. Not a spoiled brat because she was unlucky enough to get sick.
As for the sleeping arrangements, I think that's pretty normal for any kid who's been sick (or on vacation) when the normal routine gets messed up. There's often a certain period of re-training and re-adjustment to be had. However you trained her to go to sleep on her own the first time, is exactly how to deal with it again...maybe with a little bit of an extra gentle hand since it's NOT her fault she got sick and it's true she DOES need a little compassion and understanding for the fear she now lives with (to whatever degree a 2.5 year old understands fear).
I don't know what to tell you about the medication, but that's my extremely humble two cents on the behaviors of sick kids. Stay strong, Mama!!! (and don't forget to take care of yourself too!!! You're no good to anybody if you don't take a moment to regroup yourself!!!)