if you are using cursors, you will have to do it twice... the first time to get the value for the ID you want to use as the base, then again (reset the cursor may be needed) to use the value.
You might have better luck exporting your fields to a numpy array (TableToNumPyArray), do the work there then use ExtendTable to joining the results back.