Yes, that would work. Some brewers splash, some shake, some pour, some use aquarium air pumps, some use oxygen set ups, etc. If you get a ton of foaming on the beer in the carboy, like a big foamy head, that's a good sign.
I have done something pretty similar in the past, i wouldn't worry about infection much as long as you hit everything with sanitizer first.
I also shake my glass carboys. I put the stopper on the top, tip it over on it's side, dip my finger in starsan, cover the hole in the stopper with my finger, then rock it back and forth quickly either on carpet or on a towel or two on the tile floor. Little risk of breaking your carboy rolling it on carpet.