The hosts had looked well in control by the break after going in front in the 16th minute when 19-year-old Smalley – making his 44th appearance of the season – gave Shane Higgins no chance with an explosive effort from 12 yards.
Oldham had an escape nine minutes later when Dutch defender Stefan Stam hooked a goal-bound shot from Ashley Vincent off the line.
Referee Dave Foster was forced off injured just a minute into the second half and the linesman who replaced him in the middle, had a quick decision to make when he awarded Town a penalty after deciding Latics skipper Sean Gregan had pushed Shane Duff in a crowded box.
Former Liverpool trainee Stephen Gillespie made no mistake with a well-struck spot kick to give the leading scorer his 15th goal of the season.
But Cheltenham crashed to their fourth defeat in a row when another 19-year-old starlet, Lewis Alessandra, restored Oldham’s lead with three minutes to go.