code compiling, but will not actually work

Which Arduino are you using?

#include <SD.h>

512+ bytes per open file of you SRAM just went away.

String setH;
String setMinutes;
String setSeconds;
String minHour;
String minMinute;
String maxHour;
String maxMinute;

You are pissing away resources needlessly. You don't have enough to be wasting on the String class.

long brain_data[sampleSize];

Nearly 1/4 of the memory on a 328-based Arduino...

  Serial.print("Initializing SD card..."); //so this is where the error occurs. This does not print out.

String literals end up in SRAM, unless you take some simple steps:
Serial.print(F("Initializing SD card...")); //so this is where the error occurs. This does not print out.

The problem is that you don't have near as much memory as you think you do.