How can I know if the word used is a noun or a gerund? For instance ‘loving’ can only be an adjective or a verb, but ‘flashing’ can be both be an on-going action and a noun( that’s why it takes the plural form ‘flashings’)?

“loving” can also be a noun (uncountable). It is often used in song lyrics, for example, as in “I need your loving”. There is also a well-known novel called “A Kind of Loving”.

If “flashing” is used as a noun then I think it is normally uncountable. “flashings” sounds odd to me. I can’t think why one would not say “flashes”. (There is another specialised sense of “flashing” used in the building trade which I am ignoring here.)

For instance, I’ve found these sentences:

‘I saw flashings in the sky.’(as a countable noun).
'Flashing your light won’t help if there is nobody around to see it. '(as a gerund)

“flashings in the sky” is not completely impossible. However, “flashes in the sky” is much, much more usual, and I don’t really understand why anyone would choose to use the former.

Note that a gerund is the progressive (ing) form of a verb functioning as a noun. In other words, a gerund is a verbal noun. If it functions as a verb, it is called a participle - to be specific, Active Progressive Participle. Look at the examples below:

Running is a good exercise. (Gerund)
He came running. (Participle)

When you say ‘She is a loving woman’, the word loving functions as a participial adjective.