button 2 (dots and fire ball)
warlock
/castsequence reset=combat/target dot1 , dot2, dot3 , dot4

mage
/castsequence reset=combat/target Frostbolt, , ,Frostbolt
This won't work the way you describe. It will :

Press 1 - dot1 + Frostbolt
Press 2 - dot2....Frostbolt 1 is still casting
Press 3 - dot 3 + nothing Frost Bolt 1 has completed casting
Press 4 - dot 4 + nothing
Press 5 - dot 1 + Frostbolt 2

Castsequence buttons are generally spammed. If you want down and dirty castsequences for brute-force spamming, what you want is something more like this :

/castsequence reset=combat/target dot1 , dot2, dot3 , dot4, Shadow Bolt, Immolation whatever else you want to be spamming after dots
/castsequence reset=combat/target Frostbolt, Frostbolt, Cone of Cold, Ice Lance blah blah blah

The button presses are indepenant of each class. IE, Press the button once, each toon will try to cast something. If 1 is already casting something, it will keep casting until the spell launches while the other toon will fire off the next spell in its cast sequence. So :

Press 1 - Warlock casts DoT1, Mage starts casting Frostbolt
Press 2 - Warlock casts DoT2, Mage completes casting Frostbolt 1
Press 3 Warlock Casts DoT3, Mage starts casting Frostbolt 2
Press 4 - Warlock casts DoT4, MAge Completes frostbolt 2
Press 5 - Warlock casts Shadow Bolt, Mage Casts Cone of Cold
Press 6 - Warlock completes Shadow Bolt, Mage casts Ice Lance

and so on. This, of course, varies based on the cast time of these spells, haste effects, global cooldown, latency and how quickly you hammer the button. Remember, the cast sequence will reset based on the following conditions : when combat ends, it will reset ; when you get a new target, it will reset ; when it reaches the end of the sequence, it will reset. This is why you want other spells at the end of the warlock macro, as most warlock DoTs are instant. Otherwise, it will reach the end of the sequence on your warlock and recast all the dots again, even if you don't need to, while you're still trying to get your mage through his sequence. So you either need more spells for the lock or null casts {, , , , }.