There is indeed a rule which tells you when you need to insert an epenthetic vowel. We have exactly the same thing in Irish, so I'll tell you the rule for Irish. In a consonant cluster made up of L, N or R before B, BH, M, MH, F, G or CH there will be an epenthetic vowel (with the exception of NG, which is pronounced as a single sound); but if there is a long vowel immediately preceding this consonant cluster, then there's no epenthetic vowel. It should be the same in Scottish Gaelic, perhaps with some very subtle variation.