Hi Sasha,
Let's split this sentence into three parts:
(i) The old clock kept ticking on the mantelpiece, as if (ii) counting the seconds left before (iii) the coming of daylight.
(i)The old clock (noun phrase - subject) kept (verb – continued in a given state) ticking (gerund) on a mantelpiece (prepositional phrase)
(ii)as if (appears to be) : The old clock (subject) appears to be (verb) counting (gerund) the seconds left (direct object of gerund)
(iii)the (determiner) coming (verbal noun) of daylight (prepositional phrase)
As you correctly pointed out, a gerund still retains verb-like properties; hence, it can take objects. In part (ii), “the seconds left” is the object of “counting”. The gerund phrase is “counting the seconds left.” (which includes the gerund and other words that complete its meaning).
A verbal noun has properties of a noun (though it is derived from a verb). Thus, it can be modified by adjectives, preceded by determiners and post-modified by prepositional phrases. In part (iii), the determiner-verbal noun- prepositional phrase structure is clearly seen.
I would like to say that gerund phrases can also include prepositional phrases as well. For example: "My greatest challenge in school is focusing on my reading." Here, "focusing on my reading" is a gerund phrase and "on my reading" is a prepositional phrase found within the gerund phrase.
The main difference between verbal nouns and gerunds is that gerunds can take an object while verbal nouns do not.
I may also not be totally accurate in my analysis though this is how I would interpret the sentences.
I hope this helps.