You will arrive at Terminal 2 at Heathrow. You will need to go over to Terminal 4 for your onward flight.
There is no passport or identity control on arrivals from Dublin (usually) but there is potentially a customs inspection. In reality it is unlikely you will be stopped by customs officers. After you collect your bag and exit, you will need to walk over to Heathrow Central, to catch a shuttle train over to Terminal 4. The shuttle is free. This takes about 15-20 minutes. Then you need to check in with Malaysian Airlines, drop your bag and clear security again.
If you are fast and everything works, 2 hours would be sufficient for this on most days. But you have no protection if anything goes wrong. You are responsible if your Aer Lingus delays your flight or takes time in delivering your bags. If you miss your Malaysian Airlines flight your ticket will be cancelled (including the return part), and you will probably have to buy a new ticket.
Therefore I strongly advise something more like 5 or 6 hours, or perhaps even an overnight stay.