I’d add to this great explanation by including that ‘Ope’ doubles as an ‘oh shit’ or ‘whoops’ expression.
Examples include dropping something, tripping, making a mistake, and also used in situations where we feel rude asking someone to do something. As you said, the classic ’ope, gonna squeeze past yah’ is because our weird northern hospitality makes us feel uncomfortable being rude so we say ‘ope’ to signal we’re aware that we are inconveniencing the other person. Even though ‘ganders will honk at each other for other shit, we don’t typically like to be seen as infringing on someone else’s autonomy given the midwest is a big ‘don’t tell me what to do and I won’t tell you what to do’ culture.
On the topic, I’d also like to state for the record that Eminem is saying ‘Ope! There goes gravity’ which has a completely different connotation than ‘oh there goes gravity’ as non-midwesterners often translate it to. Oh is too passive compared to Ope which, again, is in the ‘oh shit that was unintentional’ meaning that only the power of Ope can express. I know this seems like such a small issue but it enrages ‘ganders to a degree unfathomable to those outside the midwest, so best steer clear of that. Like our geese, we can get real uppity over random shit, if you piss us off all that northern hospitality melts away to be replaced with HONK.
p.s. if you don’t finish off the “ope, ‘spose it’s that time” without slapping your thighs with both hands as you get up, I’m pretty sure you can be charged with a war crime ‘round these parts.