as ambident nuclephile, unprotected methimazole can react both on N- and S-centre. Proprotions depend on nature of electrophile. Acylation agents give more N-product, alkylation agents- more S-substitution. Thermodynamic is on the site of N-product, so long heating often led to N-product by acylation. But alkylation is usually irreversible. Please report what is electrophilic component - to get more accurate answer.
this is very complex case. Soft-hard effect for N- and S-centres, steric effects, protonation - because alcohols and ethers stabilizes thiourea N-protonation (DOI: 10.1002/zaac.200500157 ) that suppress nucleophilic power considerably.
Me(R)O-H(+) is not good alkylation agent in your case, IMHO.
To get better results, you can try transform methimazole in salt (for example, in reaction with NaH in dry THF, DME or diglym CH3OCH2CH2OCH2CH2OCH3); use alkyliodide (sulfate, tosylate, triflate) as alkylating agent, keep reaction temperature high (diglym is proper solvent because of high boiling point, inertness in reaction conditions and good complexing properties to Na+).
As alternative way, methimazole can be oxidized to dimer (R-S-S-R) to block S-nucleophilic center, then will reduced after alkylation.