I don't think that's possible. There is an out-of-the-box collision detection solution, but I've never found it particularly useful, and you have to manually pick two sets of bodies to compare for collisions (leftmost icon - Analiza kolizji).

As a result you will get a report like this one:

I've glanced at Inventor API reference sheets but I couldn't find anything about collision detection so it might not be straightforward to write a custom plug in to do it the way you would like to, but you will have to ask someone more experienced with inventor programming to confirm, meanwhile I'd like to suggest some alternative solutions.
If you find yourself moving/adjusting parts in assembly by freely dragging them around instead of using constraints, you might consider creating a contact set which will prevent selected parts from intersecting. Activate contact analysis (second leftmost button on the top image) and add the parts you are worried about to the contact set using RMB context menu

Often when I have to keep adjusting several parts in an assembly I find it very inconvenient and switch instead to multi-bodied workflow. Afterwards you can create components out of each solid with Make component (they will be linked to the multibodied solid, so modifications in the base component will alter individual parts you've created) or keep them as they are.
