This construction has nothing to do with the equative marker as or the comparative marker than. They appear in equative and comparative constructions, where they have their own jobs. They don't control the verbs or verb forms that are used with them, so, to answer the question the way it was asked, as doesn't take anything.
The reason for the bare infinitive is that the to is not required, since the main predicate governs an infinitive in both clauses, and to was used in the first clause, so it's redundant (but possible) in the second. It's a form of conjunction reduction, though it functions inside a construction.
In the two example sentences in the question
- It is as difficult to swim as (to) drive.
- She is better able to speak than (to) write.
the repeated infinitive marker to is deleted in the parallel infinitive clauses at the end, but it could have been left in. The omission is optional, not obligatory, and its optionality is part of the equative and comparative constructions. These constructions have any number of optional attachments, like a Cuisinart:
- It is as difficult for her to drive carefully as it is for him to drive carelessly.
- Her driving is as difficult for me to observe as it must be for her husband to experience.
- Driving with her is as delightful as flying.
In any of the above, substitute more ... than for as ... as to get a comparative instead of an equative construction. Superlative, the highest in that syntactic paradigm, works differently from the first two, because its baseline clause doesn't have to be parallel:
- Driving with her is the best <
Oh, and grammar is spelled without E's. It's pronounced the same as grammer, which makes more sense, but the spelling's wrong. Normally spelling isn't noticed much, but grammar is a word you really want to spell right.