Let's say that the ball is right over the net, and one player of each team is trying to push it to the other side. What is the rule if they just happen to hold the ball between each others hands for a really long time?
What you describe is called a "joust" (in American terminology), and it is legal. From Team USA's "Guide to Volleyball Basics":
Joust - when two players on opposing sides attempt to block the ball at the same time pushing it onto each other’s side of the net.
Apparently jousting used to be illegal, but this page says it was made legal in 1999:
14.2.4 is a new Rule concerning the Joust, which is a ball held between opponents over the net. This will no longer be considered a double fault (caught ball). The new Rule is the same as played in Beach Volleyball. This eliminates a referee's decision in this play. Play will continue, and the side on which the ball falls after the contact over the net will have three additional contacts. As with any other ball simultaneously contacted by both sides over the net and if it goes out after the contact, it will be considered the fault of the team on the opposite side. If during the Joust a net fault occurs that infraction will be whistled and play stopped. If there is a simultaneous net fault, then a replay will be indicated.
The term "joust" may not be used internationally, but the FIVB rules still say that extended contact with the ball over the net by two opponents is legal:
126.96.36.199 When two opponents touch the ball simultaneously over the net and the ball remains in play, the team receiving the ball is entitled to another three hits. If such a ball goes “out”, it is the fault of the team on the opposite side.
188.8.131.52 If simultaneous hits by two opponents over the net lead to an extended contact with the ball, play continues.