Your case has merit, the issue is that the home improvement commission is there to protect the home owner and not the individual who purchase for investment which essentially places your transaction in the commercial realm.
The reason the home improvement commission does not regulate unlicensed contractors is that in the state of MD. you are not obligated to pay an unlicensed contractor regardless of any contract you may have entered into.
I suggest that the realtor has probably breach ethical boundaries which may well cost license and fines which will be determined by the real estate commission.
I am licensed as both an agent and a home improvement contractor but I keep a firewall between the transactions.
Your best bet is to consult with an attorney who is versed in construction law, they should be able to give you a heads up in relation to any laws that have been broken so that civil and criminal action can be taken.