Azure AD Connect sync interval can't be changed lower than 30 minutes. There's only so much you can do to optimize when there are 4 or 5 different steps running on different intervals. This honestly probably needs a consultant rather than Q&A, but here are some questions to ask:
1) What does MIM add here? Is it pulling from an LDAP or SQL source that could be connected directly to AAD Connect directly with custom config with generic LDAP/SQL connector? This needs a consultant to configure, FYI.
2) What does the script do that group based licensing + dynamic groups in AAD cannot do?
3) Is this a problem solely for new user creation and them gaining initial access, or is this also a problem more regularly with changes in access where licenses need to be added/removed?
3a) If it's solely a new user creation / initial onboarding issue, what's an acceptable amount of time for it to take for a user to be created and gain any license assignments?
3b) If it's also a problem for changes in access for existing users, what changes are used as the trigger for the license removals/additions? Group memberships, attributes on the users, etc..? Can these be moved to another more efficient process?