You can use PCKeyboardHack to change caps lock to F19. Then save this as private.xml:
<?xml version="1.0"?>
<root>
<item>
<name>caps1</name>
<identifier>caps1</identifier>
<autogen>__KeyToKey__ KeyCode::F19, KeyCode::CAPSLOCK</autogen>
</item>
<item>
<name>caps2</name>
<identifier>caps2</identifier>
<autogen>__KeyToKey__ KeyCode::F19, KeyCode::CONTROL_L</autogen>
</item>
</root>
And use this script to toggle the settings:
k=/Applications/KeyRemap4MacBook.app/Contents/Applications/KeyRemap4MacBook_cli.app/Contents/MacOS/KeyRemap4MacBook_cli
if $k changed | grep -q ^caps1=; then
$k disable caps1
$k enable caps2
else
$k enable caps1
$k disable caps2
fi
It would be easier to just assign another key combination to caps lock though:
<autogen>__KeyOverlaidModifier__ KeyCode::CONTROL_L, ModifierFlag::FN, KeyCode::CONTROL_L, ModifierFlag::FN, KeyCode::CAPSLOCK</autogen>
This would be triggered on key down, so you'd have to press control before fn for key combinations like fn+control+down:
<autogen>__KeyToKey__ KeyCode::CONTROL_L, ModifierFlag::FN, KeyCode::CAPSLOCK</autogen>