When will organometallics act as base or nucleophile? I would like to ask if the hydrogen next to carbonyl group is acidic,and organometallics are strong base, when will it act as a base and extracts the acidic proton and when will it attack the carbonyl carbon?

Also I would also like to ask, for bases when will it attack the acidic proton to form a enolate and when will it attack the carbonyl carbon directly to form an hemiacetal/hemiketals?
Grignard is a base as well as an nucleophile. When there's a strong electron deficient group it'll attack there, when there' a very acidic group it'll attack there. For other bases it depends upon their relative basicity and nucleophilicity. BAsicity is thermodynamically related while nucleophiicity is kinetically decide. They're silent about each other. You need to practice and gather examples and an experience too :D