During addToCart request, you can get the data you want this way
This should return something like
[uenc] => ...
[product] => ...
[form_key] => ...
[options] => Array
[XXXX] => YYYY
Where YYYY inside "options" in this example should be the value you want (12345 in your example), XXXX should be the custom option id
This should work in your observer, as
Mage::app()->getRequest() can be accessed there, or maybe you'd want to use some generic controller_action event... not sure why you need to do your thing before product is added to cart, so it's your choice