While the Medal of Honor existed from 1862 onward, it was restricted to ENLISTED RANKS till 3 March 1863, thus by the time of Gettysburg Officer could be awarded the Medal of Honor. Now, I do NOT know when the actual act became law, most such laws do NOT come into operation for 30 days after passing Congress (Unless Congress sets a different date in the Law itself) but it appears he was eligible (Through some laws only become effective at the end of the year the law was passed, so it is possible that Officer were NOT Eligible till 1/1/1864, well after Gettysburg).
The reason Officers were excluded from the Medal of Honor was Officer had the ability to be granted "Bevert" ranks for such actions, thus you had cases like Colonel, Bevert General, George Custer. He made Bevert General for his actions in the Civil War (His Brother Lt Custer, who would die with him at the Little Big Horn had been awarded the Medal of Honor twice during the Civil war). George Custer himself never received the Medal of Honor, just Bevert Ranks above his permanent rank of Colonel.
Thomas Custer earned his first Medal of Honor as a Corporal in 1863, his Second as a First Lieutenant under his Brother's command in 1865 (please note there is some confusion as to the first award, one source says 1863, another says 1865 but both says he was a 2nd lieutenant in a Calvary unit, which he only became in 1864, in 1863 he was a corporal in an Infantry Unit).
More on the Medal of Honor
http://www.cmohs.org/http://en.wikipedia.org/wiki/Medal_of_HonorMore on Thomas Custer:
http://en.wikipedia.org/wiki/Thomas_CusterMore on Beverts:
http://en.wikipedia.org/wiki/Brevet_(military)
Just comments on this officer eligibility for the Medal of Honor for his actions in Gettysburg.
List of Civil War Medal of Honor Winners (Which shows Thomas Custer winning the medal in 1863 and 1865 but both time as member of the Calvary NOT the Infantry):
http://www.history.army.mil/html/moh/civwaral.html