furnace 4 flashes error code
High limits and you

A "high limit" switch protects the furnace against overheating and damage  -- it's located in the output duct, or plenum, of the furnace and turns the furnace off if things get too hot up there.  The usual cause of a high limit trip is inadequate airflow -- in your case, because an apparently faulty connection was causing the fan to not run.

If you continue to get the "electrical burning" smell after fixing the connections -- that's a sign the fan motor on your furnace is on the way out the door.  Generally, you'll need to have an HVAC service tech come in and swap it for a replacement.  (If you can access the other side of the connection, you can also use a voltmeter to measure the voltage drop across it -- anything more than a volt is cause for serious concern.)