Yeah, this should be possible and some of the action bar- or display block- addons already use such a "sticky" feature.
There also exist libraries which check if your frame can be stuck to another and handle their positioning. You may consider takting a look at:
-
LibStickyFrames-2.0
- Tuller's FlyPaper library, for example found in
Dominos
-
Bartender3/libs/StickyFrames.lua
Dragging only up and down while grouped could be, as far as I know, a problem, because the Blizzard API handles moving the way that you can move the frame freely and not only in a specific direction.
You'll have to code the background texture-code completely by yourself, but it should be doable. So, I suggest, you start trying