What is the proper way to bring this wire up to code and add an outlet?
The correct answer is:  look up the code in your area.  In some parts of the USA you can't get insurance on your house unless a licenced electrician does the work  -- quite possibly with a construction permit!

If there is no code, then as a minimum I would:

1) get a hammer drill and make a proper sub-ground hole in the foundation large enough for a conduit (personally I'd use 3/4 PVC or similar). 

0) Dig your trench and expose the foundation where you want to route the wiring.

2) install the conduit and pull the wiring - make sure the gauge is sufficient for your end needs.

3) seal the conduit where it goes thru the foundation using hydraulic cement.

(yes, you OCD-ers, I know I wrote them in the wrong order)