Was this inappropriate behavior for dentist to shove my head to the side when neck muscles contracted during long procedure?

WOW. So from your perspective a shove and possibly from your dentist's perspective - just repositioning your head. Communication is the key - hopefully you did or in the future you will communicate to your dentist when your muscles are sore, cramping and you need to stretch/massage them. If the dentist was truly rough - talk to them or switch dentists.
Need more details. Without knowing further details of the event or procedure it would be inappropriate to attempt a yes or no reply.