Сгноить is the perfective of гноить.

Гноить = 1) to subject to decomposition; 2) to keep in pernicious conditions.


Дрыхнуть (informal) = спать


Стоило is from стоить in the following meaning:

Стоит (сделать что-н.) = as soon as (something is done or happens)

So "Стоило солнцу приспуститься с зенита..." = "As soon as the sun lowered from the zenith..." or "Just as the sun lowered from the zenith..." (...something else happened immediately after this moment)


втихаря = silently, secretly, stealthily


Половину слопал, и чуть было к тротиловым шашкам, которые держали для рытья окопов, не подобрался. (I have подобрался as to straighten up. Who, the goat?)
Maybe it'll be easier for you to understand if I change the word order.

Половину слопал, и чуть было не подобрался к тротиловым шашкам, которые держали для рытья окопов.

чуть было не (сделал что-то) = nearly/almost (did something)

подобраться = to come up/approach imperceptibly

So "чуть было не подобрался" = nearly/almost came up/approached

And yes, the subject is the goat here.


Hope that helped a lot