tbh - it sounds like what you really want is instant enrolment based on an external action. The external database enrolment plugin is probably the wrong way to achieve this.
The better way to go would be to modify your external tool to make webservices calls to Moodle - so that as soon as the external application registers the enrolment you trigger a webservices call to Moodle to enrol the user.
As Matthew mentions - doing the sync on user action (course view/login etc) is quite ineffficient and can slow down the users access to the course a massive amount. Especially when the external database is something like oracle/ms sql and on a different server (which may not be the case for you.)
There are also a number of web-based tools that allow you to connect 2 different applications using a workflow like IFTTT, Zapier etc - you might be able to use one of those to connect Moodle and your external app. (Note: Zapier webhooks don't work natively with Moodle's core webservices, so if you go down that route you might need to do some development on the webservice protocols in Moodle to make it work... Our restful webservice gets you close, but the authorization header format needs to be slightly different)