Essentially, what this request does is allow the lord to build a guildhouse or temple without being part of the guild or religion.
The ability of a lord to build a temple to a religion of which he is not a member has been routinely rejected in the past. I don't really see this changing. Send an elder priest to give him a private sermon to convert, then he can build the temple.
As far as guilds go, just invite the lord into the guild and then have him build the guildhouse. (Or have him build it, promote you to leadership, then leave.) Yes, he may have to travel to join your guild. But your job is to make membership in the guild, or its presence in his region, worth something to him.
I don't really see any particular need for code changes to get this done.