These situations, with both balls close, and in a perpendicular line to the cushion, are the ones where some will lie the cue on the cloth, tip just under the cue, and quickly lift the tip, such that it hits the cue on the way up while moving past it. That shot has come up a few times here, and I know it's been a topic of discussion at other times while playing. I'm sure there are videos of it, probably Dr. Dave has one or two with that specific shot.
I always thought it was not a legal shot, but I've had a number of people tell me that it was a legal shot. If it is legal, that is a good way to deal with that situation, but if someone did that against me, we'd end up in a back and forth with me doing it too.
I tried to do the "reply" thing to include that little drawing with this post, but for some reason I keep getting errors whenever I try to reply with a quote from another post.