I would suggest putting this in a node-TYPE.tpl.php instead of node.tpl.php unless this is your only content type, but anyway, here is a quick start to accomplishing what you asked for using a simple for loop:
<?php $max = max(count($node->field_before), count($node->field_after)); ?>
<?php for ($i = 0; $i < $max; $i++): ?>
<div class='before'>Before <?php print !empty($node->field_before[$i]) ? $node->field_before[$i]['view'] : ''; ?></div>
<div class='after'>After <?php print !empty($node->field_after[$i]) ? $node->field_after[$i]['view'] : ''; ?></div>
<?php if ($i != ($max - 1)): ?>
<?php endif; ?>
<?php endfor; ?>
This can obviously be tweaked to add a default value if a field lengths are different, or skip the checking if you know that each "before value" will have a corresponding "answer value".
Also, if using default "unlimited fields", a user could rearrange them via drag and drop and potentially screw up your data. If this is a concern for you, you may want to look at Multigroup for CCK3.